FreeCalypso > hg > ffs-editor
annotate src/nucleus/hic.c @ 5:3b367f330821
components: pruned import from Selenite
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 15 May 2020 02:20:23 +0000 |
parents | 92470e5d0b9e |
children |
rev | line source |
---|---|
0
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /*************************************************************************/ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 /* Copyright Mentor Graphics Corporation 2002 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 /* All Rights Reserved. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 /* THIS WORK CONTAINS TRADE SECRET AND PROPRIETARY INFORMATION WHICH IS */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 /* THE PROPERTY OF MENTOR GRAPHICS CORPORATION OR ITS LICENSORS AND IS */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 /* SUBJECT TO LICENSE TERMS. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 /*************************************************************************/ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 /*************************************************************************/ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 /* FILE NAME VERSION */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 /* hic.c Nucleus PLUS 1.14 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 /* COMPONENT */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 /* HI - History Management */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 /* DESCRIPTION */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 /* This file contains the core routines for the History Management */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 /* component. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 /* DATA STRUCTURES */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 /* None */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 /* FUNCTIONS */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 /* HIC_Disable_History_Saving Disable history saving */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 /* HIC_Enable_History_Saving Enable history saving */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 /* HIC_Make_History_Entry_Service Make history entry service */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 /* HIC_Make_History_Entry Make system history entry */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 /* HIC_Retrieve_History_Entry Retrieve history entry */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 /* DEPENDENCIES */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 /* tc_extr.h Thread Control functions */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 /* tm_extr.h Timer management functions */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 /* hi_extr.h History functions */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 /* HISTORY */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 /* DATE REMARKS */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 /* 03-01-1993 Created initial version 1.0 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 /* 04-19-1993 Verified version 1.0 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 /* 03-01-1994 Replaced void with VOID, */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 /* modified protection logic, */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 /* resulting in version 1.1 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 /* 03-18-1994 Verified version 1.1 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 /* 04-17-1996 updated to version 1.2 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 /* 03-24-1998 Released version 1.3. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 /* 03-26-1999 Released 1.11m (new release */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 /* numbering scheme) */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 /* 04-17-2002 Released version 1.13m */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 /* 11-07-2002 Released version 1.14 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 /*************************************************************************/ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 #define NU_SOURCE_FILE |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 #include "in_defs.h" /* Initialization defines */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 #include "tc_extr.h" /* Thread control functions */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 #include "tm_extr.h" /* Timer functions */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 #include "hi_extr.h" /* History functions */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 /* Define external inner-component global data references. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 extern INT INC_Initialize_State; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 extern INT HID_History_Enable; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 extern INT HID_Write_Index; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 extern INT HID_Read_Index; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 extern INT HID_Entry_Count; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 extern TC_PROTECT HID_History_Protect; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 /* Define the actual history table. Note that this is defined in this file |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 in order to eliminate this table if none of the run-time history functions |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 are accessed. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 HI_HISTORY_ENTRY HIC_History_Table[HI_MAX_ENTRIES]; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 /*************************************************************************/ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 /* FUNCTION */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 /* HIC_Disable_History_Saving */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 /* DESCRIPTION */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 /* This function disables the history saving function. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 /* CALLED BY */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 /* Application */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 /* CALLS */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 /* TCT_Protect Protect history structures */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 /* TCT_Unprotect Release history protection */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 /* INPUTS */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 /* None */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 /* OUTPUTS */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 /* None */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 /* HISTORY */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
116 /* DATE REMARKS */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
117 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118 /* 03-01-1993 Created initial version 1.0 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 /* 04-19-1993 Verified version 1.0 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
120 /* 03-01-1994 Replaced void with VOID, */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
121 /* resulting in version 1.1 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
122 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
123 /* 03-18-1994 Verified version 1.1 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
124 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
125 /*************************************************************************/ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
126 VOID HIC_Disable_History_Saving(VOID) |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
127 { |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
128 NU_SUPERV_USER_VARIABLES |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
129 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
130 /* Switch to supervisor mode */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
131 NU_SUPERVISOR_MODE(); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
132 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
133 /* Protect the history data structures. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
134 TCT_Protect(&HID_History_Protect); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
135 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
136 /* Disable history saving by setting the enable flag to false. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
137 HID_History_Enable = NU_FALSE; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
138 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
139 /* Release protection. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
140 TCT_Unprotect(); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
141 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
142 /* Return to user mode */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
143 NU_USER_MODE(); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
144 } |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
145 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
146 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
147 /*************************************************************************/ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
148 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
149 /* FUNCTION */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
150 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
151 /* HIC_Enable_History_Saving */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
152 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
153 /* DESCRIPTION */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
154 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
155 /* This function enables the history saving function. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
156 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
157 /* CALLED BY */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
158 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
159 /* Application */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
160 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
161 /* CALLS */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
162 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
163 /* TCT_Protect Protect history structures */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
164 /* TCT_Unprotect Release history protection */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
165 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
166 /* INPUTS */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
167 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
168 /* None */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
169 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
170 /* OUTPUTS */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
171 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
172 /* None */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
173 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
174 /* HISTORY */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
175 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
176 /* DATE REMARKS */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
177 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
178 /* 03-01-1993 Created initial version 1.0 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
179 /* 04-19-1993 Verified version 1.0 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
180 /* 03-01-1994 Replaced void with VOID, */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
181 /* resulting in version 1.1 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
182 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
183 /* 03-18-1994 Verified version 1.1 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
184 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
185 /*************************************************************************/ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
186 VOID HIC_Enable_History_Saving(VOID) |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
187 { |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
188 NU_SUPERV_USER_VARIABLES |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
189 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
190 /* Switch to supervisor mode */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
191 NU_SUPERVISOR_MODE(); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
192 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
193 /* Protect the history data structures. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
194 TCT_Protect(&HID_History_Protect); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
195 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
196 /* Enable history saving by setting the enable flag to true. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
197 HID_History_Enable = NU_TRUE; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
198 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
199 /* Release protection. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
200 TCT_Unprotect(); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
201 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
202 /* Return to user mode */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
203 NU_USER_MODE(); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
204 } |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
205 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
206 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
207 /*************************************************************************/ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
208 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
209 /* FUNCTION */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
210 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
211 /* HIC_Make_History_Entry_Service */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
212 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
213 /* DESCRIPTION */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
214 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
215 /* This function makes an application entry in the history table. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
216 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
217 /* CALLED BY */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
218 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
219 /* Application */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
220 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
221 /* CALLS */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
222 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
223 /* HIC_Make_History_Entry Make a history entry */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
224 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
225 /* INPUTS */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
226 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
227 /* param1 First history parameter */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
228 /* param2 Second history parameter */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
229 /* param3 Third history parameter */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
230 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
231 /* OUTPUTS */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
232 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
233 /* None */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
234 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
235 /* HISTORY */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
236 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
237 /* DATE REMARKS */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
238 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
239 /* 03-01-1993 Created initial version 1.0 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
240 /* 04-19-1993 Verified version 1.0 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
241 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
242 /*************************************************************************/ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
243 VOID HIC_Make_History_Entry_Service(UNSIGNED param1, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
244 UNSIGNED param2, UNSIGNED param3) |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
245 { |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
246 /* Call actual function to make the history entry. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
247 HIC_Make_History_Entry(NU_USER_ID, param1, param2, param3); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
248 } |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
249 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
250 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
251 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
252 /*************************************************************************/ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
253 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
254 /* FUNCTION */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
255 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
256 /* HIC_Make_History_Entry */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
257 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
258 /* DESCRIPTION */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
259 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
260 /* This function makes an entry in the next available location in */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
261 /* the history table- if history saving is enabled. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
262 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
263 /* CALLED BY */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
264 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
265 /* Application */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
266 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
267 /* CALLS */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
268 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
269 /* TCC_Current_HISR_Pointer Retrieve current HISR pointer*/ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
270 /* TCC_Current_Task_Pointer Retrieve current task pointer*/ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
271 /* TCT_Get_Current_Protect Pickup current protection */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
272 /* TCT_Protect Protect history structures */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
273 /* TCT_Set_Current_Protect Set current protection */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
274 /* TCT_Unprotect Release history protection */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
275 /* TCT_Unprotect_Specific Release history protection */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
276 /* TMT_Retrieve_Clock Retrieve system clock */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
277 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
278 /* INPUTS */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
279 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
280 /* param1 First history parameter */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
281 /* param2 Second history parameter */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
282 /* param3 Third history parameter */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
283 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
284 /* OUTPUTS */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
285 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
286 /* None */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
287 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
288 /* HISTORY */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
289 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
290 /* DATE REMARKS */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
291 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
292 /* 03-01-1993 Created initial version 1.0 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
293 /* 04-19-1993 Verified version 1.0 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
294 /* 03-01-1994 Modified protection logic, */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
295 /* resulting in version 1.1 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
296 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
297 /* 03-18-1994 Verified version 1.1 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
298 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
299 /*************************************************************************/ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
300 VOID HIC_Make_History_Entry(DATA_ELEMENT id, UNSIGNED param1, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
301 UNSIGNED param2, UNSIGNED param3) |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
302 { |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
303 TC_PROTECT *save_protect; /* Save protect pointer */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
304 HI_HISTORY_ENTRY *pointer; /* Quick access pointer */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
305 NU_SUPERV_USER_VARIABLES |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
306 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
307 /* Switch to supervisor mode */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
308 NU_SUPERVISOR_MODE(); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
309 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
310 /* If we are not in initialization, get the current protection state */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
311 if (INC_Initialize_State == INC_END_INITIALIZE) |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
312 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
313 /* Pickup current protection. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
314 save_protect = TCT_Get_Current_Protect(); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
315 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
316 else |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
317 /* we are in initialization, just clear save_protect */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
318 save_protect = 0; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
319 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
320 /* Protect the history data structures. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
321 TCT_Protect(&HID_History_Protect); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
322 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
323 /* Determine if history saving is enabled. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
324 if (HID_History_Enable) |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
325 { |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
326 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
327 /* Yes, history saving is enabled. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
328 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
329 /* Build a pointer to the next location to write to in the table. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
330 pointer = &HIC_History_Table[HID_Write_Index]; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
331 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
332 /* Place the necessary information into the history table at the |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
333 current location. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
334 pointer -> hi_id = id; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
335 pointer -> hi_param1 = param1; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
336 pointer -> hi_param2 = param2; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
337 pointer -> hi_param3 = param3; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
338 pointer -> hi_time = TMT_Retrieve_Clock(); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
339 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
340 /* Now determine what thread we are currently in. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
341 if ((pointer -> hi_thread = |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
342 (VOID *) TCC_Current_Task_Pointer()) != NU_NULL) |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
343 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
344 /* Task thread. Set the caller flag accordingly. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
345 pointer -> hi_caller = HI_TASK; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
346 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
347 else if ((pointer -> hi_thread = |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
348 (VOID *) TCC_Current_HISR_Pointer()) != NU_NULL) |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
349 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
350 /* HISR thread. Set the caller flag accordingly. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
351 pointer -> hi_caller = HI_HISR; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
352 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
353 else |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
354 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
355 /* Neither a task or HISR, it caller must be initialization. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
356 pointer -> hi_caller = HI_INITIALIZE; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
357 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
358 /* Move the write index. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
359 HID_Write_Index++; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
360 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
361 /* Check for a wrap condition on the write index. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
362 if (HID_Write_Index >= HI_MAX_ENTRIES) |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
363 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
364 /* Wrap condition present, adjust the write index to the top of the |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
365 table. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
366 HID_Write_Index = 0; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
367 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
368 /* Increment the entries counter, if the maximum has not yet been |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
369 reached. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
370 if (HID_Entry_Count < HI_MAX_ENTRIES) |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
371 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
372 /* Increment the total entries counter. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
373 HID_Entry_Count++; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
374 else |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
375 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
376 /* Drag the read index along with the write index. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
377 HID_Read_Index = HID_Write_Index; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
378 } |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
379 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
380 /* Determine if there was protection in force before call. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
381 if (save_protect) |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
382 { |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
383 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
384 /* Make saved protection the current again. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
385 TCT_Set_Current_Protect(save_protect); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
386 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
387 /* Release the history protection. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
388 TCT_Unprotect_Specific(&HID_History_Protect); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
389 } |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
390 else |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
391 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
392 /* Release protection. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
393 TCT_Unprotect(); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
394 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
395 /* Return to user mode */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
396 NU_USER_MODE(); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
397 } |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
398 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
399 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
400 /*************************************************************************/ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
401 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
402 /* FUNCTION */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
403 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
404 /* HIC_Retrieve_History_Entry */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
405 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
406 /* DESCRIPTION */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
407 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
408 /* This function retrieves the next oldest entry in the history */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
409 /* table. If no more entries are available, an error status is */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
410 /* returned. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
411 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
412 /* CALLED BY */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
413 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
414 /* Application */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
415 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
416 /* CALLS */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
417 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
418 /* TCT_Protect Protect history structures */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
419 /* TCT_Unprotect Release history protection */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
420 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
421 /* INPUTS */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
422 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
423 /* id Destination for entry id */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
424 /* param1 Destination for parameter 1 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
425 /* param2 Destination for parameter 2 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
426 /* param3 Destination for parameter 3 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
427 /* time Destination for time of entry*/ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
428 /* task Destination of task pointer */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
429 /* hisr Destination of hisr pointer */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
430 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
431 /* OUTPUTS */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
432 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
433 /* None */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
434 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
435 /* HISTORY */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
436 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
437 /* DATE REMARKS */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
438 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
439 /* 03-01-1993 Created initial version 1.0 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
440 /* 04-19-1993 Verified version 1.0 */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
441 /* */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
442 /*************************************************************************/ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
443 STATUS HIC_Retrieve_History_Entry(DATA_ELEMENT *id, UNSIGNED *param1, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
444 UNSIGNED *param2, UNSIGNED *param3, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
445 UNSIGNED *time, NU_TASK **task, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
446 NU_HISR **hisr) |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
447 { |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
448 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
449 STATUS status; /* Completion status */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
450 HI_HISTORY_ENTRY *pointer; /* Quick access pointer */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
451 NU_SUPERV_USER_VARIABLES |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
452 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
453 /* Switch to supervisor mode */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
454 NU_SUPERVISOR_MODE(); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
455 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
456 /* Initialize status. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
457 status = NU_SUCCESS; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
458 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
459 /* Protect the history data structures. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
460 TCT_Protect(&HID_History_Protect); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
461 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
462 /* Determine if there is an entry in the history log. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
463 if (HID_Entry_Count) |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
464 { |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
465 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
466 /* Yes, there is at least one entry in the history log. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
467 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
468 /* Build a pointer to the next location to read from in the table. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
469 pointer = &HIC_History_Table[HID_Read_Index]; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
470 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
471 /* Place the necessary information into the history table at the |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
472 current location. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
473 *id = pointer -> hi_id; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
474 *param1 = pointer -> hi_param1; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
475 *param2 = pointer -> hi_param2; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
476 *param3 = pointer -> hi_param3; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
477 *time = pointer -> hi_time; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
478 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
479 /* Now determine what thread the entry was made from. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
480 if (pointer -> hi_caller == HI_TASK) |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
481 { |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
482 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
483 /* Setup the task return parameter. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
484 *task = (NU_TASK *) pointer -> hi_thread; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
485 *hisr = NU_NULL; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
486 } |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
487 else |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
488 { |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
489 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
490 /* In either HISR or initialize case place the thread value |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
491 in the HISR return parameter. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
492 *hisr = (NU_HISR *) pointer -> hi_thread; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
493 *task = NU_NULL; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
494 } |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
495 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
496 /* Move the read index. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
497 HID_Read_Index++; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
498 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
499 /* Check for a wrap condition on the read index. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
500 if (HID_Read_Index >= HI_MAX_ENTRIES) |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
501 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
502 /* Wrap condition present, adjust the read index to the top of the |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
503 table. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
504 HID_Read_Index = 0; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
505 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
506 /* Decrement the entries counter. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
507 HID_Entry_Count--; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
508 } |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
509 else |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
510 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
511 /* Return the end of history log status. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
512 status = NU_END_OF_LOG; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
513 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
514 /* Release protection. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
515 TCT_Unprotect(); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
516 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
517 /* Return to user mode */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
518 NU_USER_MODE(); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
519 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
520 /* Return completion status to the caller. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
521 return(status); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
522 } |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
523 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
524 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
525 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
526 |