FreeCalypso > hg > fc-selenite
annotate src/nucleus/csc.c @ 172:a0f935d68377
targets: gtm900 added
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 19 Jun 2019 04:38:43 +0000 |
parents | 0f80e1e4dce4 |
children |
rev | line source |
---|---|
7
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /*************************************************************************/ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 /* Copyright Mentor Graphics Corporation 2002 */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 /* All Rights Reserved. */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 /* THIS WORK CONTAINS TRADE SECRET AND PROPRIETARY INFORMATION WHICH IS */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 /* THE PROPERTY OF MENTOR GRAPHICS CORPORATION OR ITS LICENSORS AND IS */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 /* SUBJECT TO LICENSE TERMS. */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 /*************************************************************************/ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 /*************************************************************************/ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 /* FILE NAME VERSION */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 /* csc.c Nucleus PLUS 1.14 */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 /* COMPONENT */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 /* CS - Common Services */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 /* DESCRIPTION */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 /* This file contains linked list manipulation facilities used */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 /* throughout the Nucleus PLUS system. These facilities operate */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 /* on doubly-linked circular lists. */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 /* DATA STRUCTURES */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 /* None */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 /* FUNCTIONS */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 /* CSC_Place_On_List Place node at the end of a */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 /* list */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 /* CSC_Priority_Place_On_List Place node in priority order */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 /* on a list */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 /* CSC_Remove_From_List Remove a node from a list */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 /* DEPENDENCIES */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 /* nucleus.h Nucleus PLUS constants */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 /* cs_defs.h Common service definitions */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 /* HISTORY */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 /* DATE REMARKS */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 /* 03-01-1993 Created initial version 1.0 */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 /* 04-19-1993 Verified version 1.0 */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 /* 03-01-1994 Changed void to VOID, removed */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 /* clearing link pointers during */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 /* removal of a node from a list, */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 /* resulting in version 1.1 */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 /* 03-18-1994 Verified version 1.1 */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 /* 04-17-1996 updated to version 1.2 */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 /* 03-24-1998 Released version 1.3. */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 /* 03-26-1999 Released 1.11m (new release */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 /* numbering scheme) */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 /* 04-17-2002 Released version 1.13m */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 /* 11-07-2002 Released version 1.14 */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 /*************************************************************************/ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 #define NU_SOURCE_FILE |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 #include "cs_defs.h" /* Include CS definitions */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 #include "cs_extr.h" /* Common service functions */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 /*************************************************************************/ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 /* FUNCTION */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 /* CSC_Place_On_List */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 /* DESCRIPTION */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 /* This function places the specified node at the end of specified */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 /* linked list. */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 /* CALLED BY */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 /* various components */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 /* CALLS */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 /* None */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 /* INPUTS */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 /* head Pointer to head pointer */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 /* node Pointer to node to add */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 /* OUTPUTS */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 /* modified list */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 /* HISTORY */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 /* NAME DATE REMARKS */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 /* W. Lamie 03-01-1993 Created initial version 1.0 */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 /* D. Lamie 04-19-1993 Verified version 1.0 */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 /*************************************************************************/ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 #ifndef NU_INLINE |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 VOID CSC_Place_On_List(CS_NODE **head, CS_NODE *new_node) |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 { |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 NU_SUPERV_USER_VARIABLES |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 /* Switch to supervisor mode */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 NU_SUPERVISOR_MODE(); |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
116 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
117 /* Determine if the list in non-empty. */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118 if (*head) |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 { |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
120 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
121 /* The list is not empty. Add the new node to the end of |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
122 the list. */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
123 new_node -> cs_previous = (*head) -> cs_previous; |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
124 (new_node -> cs_previous) -> cs_next = new_node; |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
125 new_node -> cs_next = (*head); |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
126 (new_node -> cs_next) -> cs_previous = new_node; |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
127 } |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
128 else |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
129 { |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
130 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
131 /* The list is empty, setup the head and the new node. */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
132 (*head) = new_node; |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
133 new_node -> cs_previous = new_node; |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
134 new_node -> cs_next = new_node; |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
135 } |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
136 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
137 /* Return to user mode */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
138 NU_USER_MODE(); |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
139 } |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
140 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
141 #endif |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
142 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
143 /*************************************************************************/ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
144 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
145 /* FUNCTION */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
146 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
147 /* CSC_Priority_Place_On_List */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
148 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
149 /* DESCRIPTION */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
150 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
151 /* This function places the specified node after all other nodes on */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
152 /* the list of equal or greater priority. Note that lower */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
153 /* numerical values indicate greater priority. */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
154 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
155 /* CALLED BY */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
156 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
157 /* various components */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
158 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
159 /* CALLS */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
160 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
161 /* None */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
162 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
163 /* INPUTS */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
164 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
165 /* head Pointer to head pointer */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
166 /* node Pointer to node to add */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
167 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
168 /* OUTPUTS */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
169 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
170 /* modified list */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
171 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
172 /* HISTORY */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
173 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
174 /* NAME DATE REMARKS */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
175 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
176 /* W. Lamie 03-01-1993 Created initial version 1.0 */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
177 /* D. Lamie 04-19-1993 Verified version 1.0 */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
178 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
179 /*************************************************************************/ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
180 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
181 VOID CSC_Priority_Place_On_List(CS_NODE **head, CS_NODE *new_node) |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
182 { |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
183 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
184 CS_NODE *search_ptr; /* List search pointer */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
185 NU_SUPERV_USER_VARIABLES |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
186 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
187 /* Switch to supervisor mode */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
188 NU_SUPERVISOR_MODE(); |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
189 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
190 /* Determine if the list in non-empty. */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
191 if (*head) |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
192 { |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
193 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
194 /* Search the list to find the proper place for the new node. */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
195 search_ptr = (*head); |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
196 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
197 /* Check for insertion before the first node on the list. */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
198 if (search_ptr -> cs_priority > new_node -> cs_priority) |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
199 { |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
200 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
201 /* Update the head pointer to point at the new node. */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
202 (*head) = new_node; |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
203 } |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
204 else |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
205 { |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
206 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
207 /* We know that the new node is not the highest priority and |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
208 must be placed somewhere after the head pointer. */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
209 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
210 /* Move search pointer up to the next node since we are trying |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
211 to find the proper node to insert in front of. */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
212 search_ptr = search_ptr -> cs_next; |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
213 while ((search_ptr -> cs_priority <= new_node -> cs_priority) && |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
214 (search_ptr != (*head))) |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
215 { |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
216 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
217 /* Move along to the next node. */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
218 search_ptr = search_ptr -> cs_next; |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
219 } |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
220 } |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
221 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
222 /* Insert before search pointer. */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
223 new_node -> cs_previous = search_ptr -> cs_previous; |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
224 (new_node -> cs_previous) -> cs_next = new_node; |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
225 new_node -> cs_next = search_ptr; |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
226 (new_node -> cs_next) -> cs_previous = new_node; |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
227 } |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
228 else |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
229 { |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
230 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
231 /* The list is empty, setup the head and the new node. */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
232 (*head) = new_node; |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
233 new_node -> cs_previous = new_node; |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
234 new_node -> cs_next = new_node; |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
235 } |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
236 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
237 /* Return to user mode */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
238 NU_USER_MODE(); |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
239 } |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
240 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
241 /*************************************************************************/ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
242 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
243 /* FUNCTION */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
244 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
245 /* CSC_Remove_From_List */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
246 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
247 /* DESCRIPTION */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
248 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
249 /* This function removes the specified node from the specified */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
250 /* linked list. */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
251 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
252 /* CALLED BY */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
253 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
254 /* various components */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
255 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
256 /* CALLS */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
257 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
258 /* None */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
259 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
260 /* INPUTS */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
261 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
262 /* head Pointer to head pointer */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
263 /* node Pointer to node to add */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
264 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
265 /* OUTPUTS */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
266 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
267 /* modified list */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
268 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
269 /* HISTORY */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
270 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
271 /* NAME DATE REMARKS */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
272 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
273 /* W. Lamie 03-01-1993 Created initial version 1.0 */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
274 /* D. Lamie 04-19-1993 Verified version 1.0 */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
275 /* W. Lamie 03-01-1994 Removed clearing link pointers */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
276 /* during removal of a node from */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
277 /* list, resulting in version 1.1 */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
278 /* R. Pfaff - */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
279 /* D. Lamie 03-18-1994 Verified version 1.1 */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
280 /* */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
281 /*************************************************************************/ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
282 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
283 #ifndef NU_INLINE |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
284 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
285 VOID CSC_Remove_From_List(CS_NODE **head, CS_NODE *node) |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
286 { |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
287 NU_SUPERV_USER_VARIABLES |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
288 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
289 /* Switch to supervisor mode */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
290 NU_SUPERVISOR_MODE(); |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
291 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
292 /* Determine if this is the only node in the system. */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
293 if (node -> cs_previous == node) |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
294 { |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
295 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
296 /* Yes, this is the only node in the system. Clear the node's |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
297 pointers and the head pointer. */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
298 (*head) = NU_NULL; |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
299 } |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
300 else |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
301 { |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
302 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
303 /* Unlink the node from a multiple node list. */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
304 (node -> cs_previous) -> cs_next = node -> cs_next; |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
305 (node -> cs_next) -> cs_previous = node -> cs_previous; |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
306 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
307 /* Check to see if the node to delete is at the head of the |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
308 list. */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
309 if (node == *head) |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
310 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
311 /* Move the head pointer to the node after. */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
312 *head = node -> cs_next; |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
313 } |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
314 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
315 /* Return to user mode */ |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
316 NU_USER_MODE(); |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
317 } |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
318 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
319 #endif |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
320 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
321 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
322 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
323 |
0f80e1e4dce4
src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
324 |