annotate gsm-fw/gpf/frame/vsi_ppm.c @ 316:79080922d8e4

GPF: FRAME C sources and include files imported from LoCosto source
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Thu, 10 Apr 2014 04:06:05 +0000
parents
children 2c760f6b1fe0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
316
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
2 +------------------------------------------------------------------------------
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
3 | File: vsi_ppm.c
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
4 +------------------------------------------------------------------------------
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5 | Copyright 2002 Texas Instruments Berlin, AG
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6 | All rights reserved.
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
7 |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8 | This file is confidential and a trade secret of Texas
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9 | Instruments Berlin, AG
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10 | The receipt of or possession of this file does not convey
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11 | any rights to reproduce or disclose its contents or to
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12 | manufacture, use, or sell anything it may describe, in
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
13 | whole, or in part, without the specific written consent of
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
14 | Texas Instruments Berlin, AG.
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
15 +-----------------------------------------------------------------------------
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
16 | Purpose : This Module defines the virtual system interface part
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
17 | for the primitive partition pool supervision.
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
18 +-----------------------------------------------------------------------------
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
19 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
20
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
21 #ifndef __VSI_PPM_C__
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
22 #define __VSI_PPM_C__
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
23 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
24
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
25 #ifdef MEMORY_SUPERVISION
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
26
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
27 /*==== INCLUDES ===================================================*/
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
28
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
29 #include "string.h"
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
30 #include "typedefs.h"
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
31 #include "os.h"
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
32 #include "vsi.h"
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
33 #include "tools.h"
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
34 #include "frm_defs.h"
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
35 #include "frm_types.h"
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
36 #include "frm_glob.h"
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
37
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
38 /*==== TYPES ======================================================*/
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
39
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
40 typedef struct
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
41 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
42 USHORT pool_nr;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
43 USHORT group_nr;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
44 } T_POOL_GROUP;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
45
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
46 typedef struct
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
47 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
48 SHORT state_id;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
49 char const * state_name;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
50 } T_PARTITION_STATE;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
51 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
52 * indices to read the stored counters
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
53 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
54 typedef enum { TOTAL,CURRENT_BYTE,CURRENT_PART,MAX_RANGES,MAX_BYTE_MEM,MAX_PART_MEM } T_COUNTER_READ;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
55
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
56 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
57 * indices to update the counters
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
58 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
59 typedef enum { DECREMENT, INCREMENT, STORE_MAX_BYTE, STORE_MAX_PART } T_COUNTER_UPDATE;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
60
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
61 /*==== CONSTANTS ==================================================*/
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
62
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
63 #define OWNER_IS_COM_HANDLE 0x8000
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
64 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
65 * Partition States
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
66 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
67 #define PARTITION_FREED 0x0001
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
68 #define PARTITION_ALLOCATED 0x0002
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
69 #define PARTITION_RECEIVED 0x0004
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
70 #define PARTITION_SENT 0x0008
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
71 #define PARTITION_REUSED 0x0010
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
72 #define PARTITION_ACCESSED 0x0020
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
73 #define PARTITION_STORED 0x0040
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
74 #define MAX_PARTITION_STATE 7
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
75
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
76 #define ALLOWED_ALLOCATE_STATES (PARTITION_FREED)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
77 #define ALLOWED_RECEIVE_STATES (PARTITION_SENT|PARTITION_RECEIVED)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
78 #define ALLOWED_SEND_STATES (PARTITION_ALLOCATED|PARTITION_REUSED|\
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
79 PARTITION_RECEIVED|PARTITION_ACCESSED|\
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
80 PARTITION_STORED)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
81 #define ALLOWED_REUSE_STATES (PARTITION_ALLOCATED|PARTITION_RECEIVED|\
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
82 PARTITION_STORED|PARTITION_REUSED)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
83 #define ALLOWED_DEALLOCATE_STATES (PARTITION_RECEIVED|PARTITION_ALLOCATED|\
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
84 PARTITION_SENT|PARTITION_REUSED|\
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
85 PARTITION_ACCESSED|PARTITION_STORED)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
86 #define ALLOWED_ACCESS_STATES (PARTITION_ALLOCATED|PARTITION_RECEIVED|\
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
87 PARTITION_REUSED|PARTITION_ACCESSED|\
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
88 PARTITION_STORED)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
89 #define ALLOWED_STORE_STATES (PARTITION_ALLOCATED|PARTITION_RECEIVED|\
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
90 PARTITION_REUSED|PARTITION_ACCESSED|\
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
91 PARTITION_SENT)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
92
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
93 #define FORBIDDEN_ALLOCATE_STATES (0xffff&~ALLOWED_ALLOCATE_STATES)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
94 #define FORBIDDEN_RECEIVE_STATES (0xffff&~ALLOWED_RECEIVE_STATES)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
95 #define FORBIDDEN_SEND_STATES (0xffff&~ALLOWED_SEND_STATES)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
96 #define FORBIDDEN_REUSE_STATES (0xffff&~ALLOWED_REUSE_STATES)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
97 #define FORBIDDEN_DEALLOCATE_STATES (0xffff&~ALLOWED_DEALLOCATE_STATES)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
98 #define FORBIDDEN_ACCESS_STATES (0xffff&~ALLOWED_ACCESS_STATES)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
99 #define FORBIDDEN_STORE_STATES (0xffff&~ALLOWED_STORE_STATES)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
100
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
101 #define PPM_END_MARKER ((char)0xff)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
102
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
103 #define PARTITION_SIZE(g,p) (partition_grp_config[g].grp_config[p].part_size)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
104
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
105 #ifndef RUN_INT_RAM
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
106 const T_PARTITION_STATE partition_state[MAX_PARTITION_STATE+1] =
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
107 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
108 { PARTITION_FREED, "FREED" },
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
109 { PARTITION_ALLOCATED, "ALLOCATED" },
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
110 { PARTITION_RECEIVED, "RECEIVED" },
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
111 { PARTITION_SENT, "SENT" },
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
112 { PARTITION_REUSED, "REUSED" },
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
113 { PARTITION_ACCESSED, "ACCESSED" },
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
114 { PARTITION_STORED, "STORED" },
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
115 { 0, NULL }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
116 };
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
117 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
118
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
119 /*==== EXTERNALS ==================================================*/
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
120
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
121 /* -------------- S H A R E D - BEGIN ---------------- */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
122 #ifdef _TOOLS_
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
123 #pragma data_seg("FRAME_SHARED")
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
124 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
125
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
126 extern T_HANDLE TST_Handle;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
127 extern const T_FRM_PARTITION_GROUP_CONFIG partition_grp_config[];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
128 extern T_HANDLE * PoolGroupHandle [];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
129 extern OS_HANDLE ext_data_pool_handle;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
130 extern USHORT MaxPoolGroups;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
131
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
132 /*==== VARIABLES ==================================================*/
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
133
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
134 #ifndef RUN_INT_RAM
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
135
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
136 USHORT NumberOfPPMPartitions = 0;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
137 USHORT NumOfPPMPools = 0;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
138 USHORT NumOfPPMGroups;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
139 USHORT NumOfPrimPools;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
140 USHORT NumOfDmemPools;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
141 T_PARTITION_POOL_STATUS PoolStatus;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
142 T_PARTITION_STATUS *PartitionStatus;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
143 T_OVERSIZE_STATUS *PartitionOversize;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
144 T_COUNTER *PartitionCounter;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
145 T_POOL_GROUP *PoolGroup;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
146 #ifdef OPTIMIZE_POOL
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
147 T_COUNTER *ByteCounter;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
148 T_COUNTER *RangeCounter;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
149 int *GroupStartRange;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
150 int *GroupStartCnt;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
151 #endif /* OPTIMIZE_POOL */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
152 int ppm_check_partition_owner;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
153
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
154 #else /* RUN_INT_RAM */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
155
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
156 extern int ppm_check_partition_owner;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
157 extern T_PARTITION_POOL_STATUS PoolStatus;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
158 extern T_POOL_GROUP * PoolGroup;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
159 extern USHORT NumOfPrimPools;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
160 extern USHORT NumOfDmemPools;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
161 extern int *GroupStartRange;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
162
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
163 #endif /* RUN_INT_RAM */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
164
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
165 #ifdef _TOOLS_
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
166 #pragma data_seg()
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
167 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
168 /* -------------- S H A R E D - END ---------------- */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
169
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
170 /*==== FUNCTIONS ==================================================*/
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
171
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
172 GLOBAL void SetPartitionStatus ( T_PARTITION_STATUS *pPoolStatus, const char *file, int line,
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
173 ULONG opc, USHORT Status, T_HANDLE owner );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
174
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
175 USHORT update_dyn_state ( T_HANDLE Caller, T_PRIM_HEADER *prim, T_HANDLE owner, USHORT state, const char* file, int line );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
176 BOOL UpdatePoolCounter ( T_COUNTER *pCounter, T_COUNTER_UPDATE Status, ULONG Value );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
177 void StoreRangeCounters ( T_PRIM_HEADER *prim, T_COUNTER_UPDATE Status );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
178 int GetPartitionRange ( ULONG size, USHORT group_nr, USHORT pool_nr );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
179 LONG get_partition_group ( T_PRIM_HEADER *prim, USHORT *group_nr, USHORT *pool_nr );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
180 char const *get_partition_state_name ( USHORT partition_state );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
181
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
182
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
183 #ifndef RUN_FLASH
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
184 USHORT update_dyn_state ( T_HANDLE Caller, T_PRIM_HEADER *prim, T_HANDLE owner, USHORT state, const char* file, int line )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
185 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
186 T_desc *desc;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
187 T_desc3 *desc3;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
188 T_M_HEADER *mem;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
189 T_DP_HEADER *dp_hdr;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
190 USHORT ret = TRUE;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
191
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
192 if ( prim->dph_offset != 0 )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
193 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
194 dp_hdr = (T_DP_HEADER*)((ULONG*)prim + prim->dph_offset);
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
195 if ( *((ULONG*)dp_hdr) == GUARD_PATTERN )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
196 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
197 dp_hdr = (T_DP_HEADER*)dp_hdr->next;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
198 while (dp_hdr != NULL)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
199 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
200 SetPartitionStatus ( &PoolStatus.PartitionStatus [ P_PNR(dp_hdr) ], file, line, P_OPC(prim), state, owner );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
201 dp_hdr = (T_DP_HEADER*)dp_hdr->next;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
202 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
203 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
204 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
205 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
206 if ( Caller != TST_Handle )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
207 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
208 /* do not check and update the states of the primitives in descriptor lists when called by TST, because
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
209 descriptor lists are not routed to TST and will result in the warning generated below */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
210 desc = (T_desc*)(((T_desc_list*)dp_hdr)->first);
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
211 while (desc != NULL)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
212 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
213 #ifdef _NUCLEUS_
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
214 if ( *(((ULONG*)desc)-4) == 0 )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
215 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
216 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
217 mem = ((T_M_HEADER*)desc)-1;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
218 SetPartitionStatus ( &PoolStatus.PartitionStatus [P_PNR(mem)], file, line, P_OPC(prim), state, owner );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
219 if ( mem->desc_type == (VSI_DESC_TYPE3 >> 16) )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
220 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
221 desc3 = (T_desc3*)desc;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
222 mem = ((T_M_HEADER*)desc3->buffer)-1;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
223 SetPartitionStatus ( &PoolStatus.PartitionStatus [P_PNR(mem)], file, line, P_OPC(prim), state, owner );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
224 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
225 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
226 #ifdef _NUCLEUS_
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
227 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
228 vsi_o_ttrace (Caller, TC_SYSTEM,"[PPM]: FREED PARTITION 0x%lx IN DESCLIST, %s(%d)", prim,rm_path(file),line );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
229 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
230 desc = (T_desc *)desc->next;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
231 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
232 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
233 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
234 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
235 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
236 ret = FALSE;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
237 return ret;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
238 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
239 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
240
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
241 #ifndef RUN_INT_RAM
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
242 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
243 +------------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
244 | PROJECT : GSM-Frame (8415) MODULE : VSI_PPM |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
245 | STATE : code ROUTINE : get_partition_state_name|
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
246 +------------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
247
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
248 PURPOSE : update counter.
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
249
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
250 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
251 char const *get_partition_state_name ( USHORT state )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
252 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
253 USHORT i = 0;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
254
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
255 while ( partition_state[i].state_id )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
256 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
257 if ( partition_state[i].state_id == state )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
258 return partition_state[i].state_name;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
259 i++;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
260 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
261 return NULL;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
262 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
263 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
264
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
265 #ifndef RUN_FLASH
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
266 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
267 +----------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
268 | PROJECT : GSM-Frame (8415) MODULE : VSI_PPM |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
269 | STATE : code ROUTINE : check_partition_group |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
270 +----------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
271
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
272 PURPOSE : update counter.
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
273
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
274 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
275 LONG get_partition_group ( T_PRIM_HEADER *prim, USHORT *group_nr, USHORT *pool_nr )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
276 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
277 SHORT invalid_pool = 0;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
278 T_HANDLE Caller;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
279
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
280 *pool_nr = PoolGroup [ (USHORT)(P_PGR(prim)) ].pool_nr;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
281 *group_nr = PoolGroup [ (USHORT)(P_PGR(prim)) ].group_nr;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
282
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
283 if ( *group_nr > MaxPoolGroups )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
284 invalid_pool = 1;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
285
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
286 if ( *group_nr == PrimGroupHandle )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
287 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
288 if ( *pool_nr > NumOfPrimPools )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
289 invalid_pool = 1;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
290 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
291 else if ( *group_nr == DmemGroupHandle )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
292 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
293 if ( *pool_nr > NumOfDmemPools )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
294 invalid_pool = 1;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
295 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
296
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
297 if ( invalid_pool == 1 )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
298 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
299 Caller = e_running[os_MyHandle()];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
300 vsi_o_ttrace (Caller, TC_SYSTEM,
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
301 "[PPM]: Invalid Partition Pool, group: %d, pool: %d", *group_nr, *pool_nr );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
302 return VSI_ERROR;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
303 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
304
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
305 return VSI_OK;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
306 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
307 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
308
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
309 #ifndef RUN_FLASH
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
310 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
311 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
312 | PROJECT : GSM-Frame (8415) MODULE : VSI_PPM |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
313 | STATE : code ROUTINE : GetPartitionRange |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
314 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
315
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
316 PURPOSE : update counter.
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
317
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
318 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
319 int GetPartitionRange ( ULONG size, USHORT group_nr, USHORT pool_nr )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
320 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
321 int partition_range;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
322 int size_offset;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
323 int range;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
324
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
325 if ( pool_nr != 0 )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
326 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
327 partition_range = (int)(PARTITION_SIZE(group_nr,pool_nr) - PARTITION_SIZE(group_nr,pool_nr-1));
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
328
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
329 size_offset = (int)(size - (USHORT)(PARTITION_SIZE(group_nr,pool_nr-1)) - 1);
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
330 if ( size_offset < 0 )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
331 size_offset = 0;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
332 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
333 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
334 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
335 partition_range = (USHORT)(PARTITION_SIZE(group_nr,pool_nr));
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
336 if ( size == 0 )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
337 size_offset = 0;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
338 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
339 size_offset = (int)(size - 1);
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
340 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
341
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
342 range = (USHORT)((size_offset * RANGES_PER_POOL)/partition_range + pool_nr * RANGES_PER_POOL + GroupStartRange[group_nr]);
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
343
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
344 return range;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
345 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
346 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
347
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
348 #ifndef RUN_FLASH
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
349 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
350 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
351 | PROJECT : GSM-Frame (8415) MODULE : VSI_PPM |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
352 | STATE : code ROUTINE : UpdatePoolCounter |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
353 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
354
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
355 PURPOSE : update counter.
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
356
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
357 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
358 BOOL UpdatePoolCounter ( T_COUNTER *pCounter, T_COUNTER_UPDATE Status, ULONG Value )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
359 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
360
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
361 switch ( Status )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
362 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
363 case INCREMENT:
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
364 pCounter->Total += Value; /* total number */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
365 pCounter->Current += Value; /* current number */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
366 if ( pCounter->Current > pCounter->Maximum ) /* current > maximum ? */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
367 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
368 pCounter->Maximum = pCounter->Current; /* Maximum = Current */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
369 return TRUE ;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
370 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
371 break;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
372 case DECREMENT:
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
373 pCounter->Current -= Value; /* current number */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
374 break;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
375 case STORE_MAX_BYTE:
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
376 pCounter->MaxByteMemory = pCounter->Current; /* store current number */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
377 break;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
378 case STORE_MAX_PART:
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
379 pCounter->MaxPartMemory = pCounter->Current; /* store current number */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
380 break;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
381 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
382 return FALSE;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
383 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
384 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
385
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
386 #ifndef RUN_FLASH
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
387 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
388 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
389 | PROJECT : GSM-Frame (8415) MODULE : VSI_PPM |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
390 | STATE : code ROUTINE : SetPartitionStatus |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
391 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
392
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
393 PURPOSE : update the status of the partition.
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
394
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
395 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
396 GLOBAL void SetPartitionStatus ( T_PARTITION_STATUS *pPoolStatus, const char *file, int line, ULONG opc, USHORT Status, T_HANDLE owner )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
397 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
398
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
399 pPoolStatus->Status = Status;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
400 pPoolStatus->PrimOPC = opc;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
401 pPoolStatus->owner = owner;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
402 if ( Status NEQ PARTITION_FREED )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
403 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
404 os_GetTime (0,&pPoolStatus->time);
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
405 pPoolStatus->Userfile = file;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
406 pPoolStatus->Line = line;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
407 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
408 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
409 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
410
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
411 #ifdef OPTIMIZE_POOL
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
412 #ifndef RUN_FLASH
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
413 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
414 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
415 | PROJECT : GSM-Frame (8415) MODULE : VSI_PPM |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
416 | STATE : code ROUTINE : StoreRangeCounters |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
417 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
418
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
419 PURPOSE : stores the range counters for a specified partition.
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
420
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
421 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
422 void StoreRangeCounters ( T_PRIM_HEADER *prim, T_COUNTER_UPDATE Status )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
423 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
424 USHORT i;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
425
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
426 for ( i=0; i<5; i++ )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
427 UpdatePoolCounter ( &PoolStatus.RangeCounter [ P_PGR(prim)*5+i ], Status,0 );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
428 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
429 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
430
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
431 #ifndef RUN_INT_RAM
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
432 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
433 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
434 | PROJECT : GSM-Frame (8415) MODULE : VSI_PPM |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
435 | STATE : code ROUTINE : TracePoolStatistic |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
436 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
437
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
438 PURPOSE : send the statistic information specified by the parameters
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
439 to the tst interface.
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
440
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
441 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
442 LOCAL void TracePoolStatistic ( T_HANDLE Caller, USHORT group_nr, USHORT pool_nr, char const *Src,
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
443 T_COUNTER_READ Status )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
444 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
445 #define RNG_COUNT_IDX(g,p,i) (GroupStartRange[g]+p*RANGES_PER_POOL+i)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
446 #define COUNT_IDX(g,p) (GroupStartCnt[g]+p)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
447 T_FRM_PARTITION_POOL_CONFIG * pool_config;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
448 ULONG Value1;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
449 ULONG Value2;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
450 char const *Resource;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
451 BOOL TraceRange = FALSE;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
452 BOOL TraceValue = FALSE;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
453 ULONG Value[5];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
454 int i;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
455
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
456 pool_config = (T_FRM_PARTITION_POOL_CONFIG*)partition_grp_config[group_nr].grp_config + pool_nr;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
457
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
458 switch ( Status )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
459 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
460 case TOTAL:
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
461 TraceRange = TRUE;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
462 for ( i = 0; i < RANGES_PER_POOL; i++ )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
463 Value[i] = PoolStatus.RangeCounter [ RNG_COUNT_IDX(group_nr,pool_nr,i) ].Total;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
464 break;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
465 case CURRENT_BYTE:
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
466 TraceValue = TRUE;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
467 Resource = "max bytes ";
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
468 Value1 = PoolStatus.ByteCounter [ COUNT_IDX(group_nr,pool_nr) ].Current;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
469 Value2 = PoolStatus.PartitionCounter [COUNT_IDX(group_nr,pool_nr)].Current * pool_config->part_size;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
470 break;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
471 case CURRENT_PART:
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
472 TraceValue = TRUE;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
473 Resource = "part";
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
474 Value1 = PoolStatus.PartitionCounter [COUNT_IDX(group_nr,pool_nr)].Current;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
475 Value2 = pool_config->part_num;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
476
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
477 break;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
478 case MAX_RANGES:
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
479 TraceRange = TRUE;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
480 for ( i = 0; i < RANGES_PER_POOL; i++ )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
481 Value[i] = PoolStatus.RangeCounter [ RNG_COUNT_IDX(group_nr,pool_nr,i) ].Maximum;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
482 break;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
483 case MAX_BYTE_MEM:
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
484 TraceRange = TRUE;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
485 TraceValue = TRUE;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
486 Resource = "bytes ";
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
487 Value1 = PoolStatus.ByteCounter [COUNT_IDX(group_nr,pool_nr)].Maximum;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
488 Value2 = PoolStatus.PartitionCounter [COUNT_IDX(group_nr,pool_nr)].MaxByteMemory * pool_config->part_size;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
489 for ( i = 0; i < RANGES_PER_POOL; i++ )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
490 Value[i] = PoolStatus.RangeCounter [ RNG_COUNT_IDX(group_nr,pool_nr,i) ].MaxByteMemory;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
491 break;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
492 case MAX_PART_MEM:
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
493 TraceRange = TRUE;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
494 TraceValue = TRUE;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
495 Resource = "partitions";
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
496 Value1 = PoolStatus.PartitionCounter [COUNT_IDX(group_nr,pool_nr)].Maximum;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
497 Value2 = pool_config->part_num;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
498 for ( i = 0; i < RANGES_PER_POOL; i++ )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
499 Value[i] = PoolStatus.RangeCounter [ RNG_COUNT_IDX(group_nr,pool_nr,i) ].MaxPartMemory;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
500 break;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
501 default:
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
502 break;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
503 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
504
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
505 /*lint -e644, suppress Warning -- Variable may not have been initialized */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
506 if ( TraceValue )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
507 vsi_o_ttrace (Caller, TC_SYSTEM,"[PPM]: %s pool %d:%5d %s =>%3d%%",
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
508 Src, pool_nr, Value1, Resource, (Value1*100)/(Value2==0?1:Value2) );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
509
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
510 if ( TraceRange )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
511 vsi_o_ttrace (Caller, TC_SYSTEM,"[PPM]: %s partitions pool %d: %3d, %3d, %3d, %3d, %3d",Src, pool_nr,
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
512 Value[0],Value[1],Value[2],Value[3],Value[4]);
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
513 /*lint +e644 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
514
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
515 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
516 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
517 #endif /* OPTIMIZE_POOL */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
518
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
519 #ifndef RUN_INT_RAM
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
520 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
521 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
522 | PROJECT : GSM-Frame (8415) MODULE : VSI_PPM |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
523 | STATE : code ROUTINE : TracePoolStatus |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
524 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
525
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
526 PURPOSE : send the statistic information to the test interface.
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
527
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
528 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
529 GLOBAL void TracePoolstatus ( T_HANDLE Caller )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
530 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
531 T_PARTITION_STATUS *pPoolStatus;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
532 T_FRM_PARTITION_POOL_CONFIG * pool_config;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
533 USHORT i, m;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
534 USHORT group_nr, pool_nr;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
535 USHORT PartitionError = FALSE, OversizeError = FALSE;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
536 T_OVERSIZE_STATUS *pOversizeStatus;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
537 T_HANDLE owner;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
538 char *opc;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
539
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
540 pOversizeStatus = &PoolStatus.PartitionOversize[0];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
541 pPoolStatus = &PoolStatus.PartitionStatus [0];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
542 for ( i = 0; i < NumberOfPPMPartitions; i++ )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
543 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
544 if ( pPoolStatus->Status > 0 && pPoolStatus->Status NEQ PARTITION_FREED )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
545 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
546 if ( pPoolStatus->owner & OWNER_IS_COM_HANDLE )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
547 owner = pPoolStatus->owner&~OWNER_IS_COM_HANDLE;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
548 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
549 owner = pPoolStatus->owner;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
550
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
551 if ( pPoolStatus->PrimOPC && ( ((T_PRIM_HEADER*)pPoolStatus->ptr)->opc != pPoolStatus->PrimOPC ) )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
552 opc = "in desclist of OPC";
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
553 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
554 opc = "OPC";
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
555 get_partition_group ( pPoolStatus->ptr, &group_nr, &pool_nr );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
556
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
557 pool_config = (T_FRM_PARTITION_POOL_CONFIG*)partition_grp_config[group_nr].grp_config + pool_nr;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
558
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
559 vsi_o_ttrace ( Caller, TC_SYSTEM, "POOL%d%d(%s), PARTITION 0x%lx(%d), %s 0x%lx, \
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
560 %s, %s, TIME %d, %s(%d)", group_nr,pool_nr,partition_grp_config[group_nr].name, pPoolStatus->ptr,pool_config->part_size,
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
561 opc, pPoolStatus->PrimOPC, get_partition_state_name(pPoolStatus->Status), pf_TaskTable[owner].Name, pPoolStatus->time,
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
562 rm_path(pPoolStatus->Userfile), pPoolStatus->Line);
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
563 PartitionError = TRUE;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
564 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
565 pPoolStatus++;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
566 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
567
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
568 for (m = 0; partition_grp_config[m].grp_config != NULL; m++ )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
569 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
570 if ( strcmp ("TEST", partition_grp_config[m].name ) )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
571 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
572 vsi_o_ttrace ( Caller, TC_SYSTEM, "---------------------------------------------------------" );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
573 vsi_o_ttrace ( Caller, TC_SYSTEM, "[PPM]: POOL NAME: %s", partition_grp_config[m].name );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
574 pool_config = (T_FRM_PARTITION_POOL_CONFIG*)partition_grp_config[m].grp_config;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
575 for ( i = 0; pool_config != NULL; i++)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
576 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
577 if ( pool_config->part_size )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
578 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
579 #ifdef OPTIMIZE_POOL
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
580 vsi_o_ttrace ( Caller, TC_SYSTEM, "---------------------------------------------------------" );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
581 vsi_o_ttrace ( Caller, TC_SYSTEM, "[PPM]: POOL %d (size %d) ",i, pool_config->part_size );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
582 TracePoolStatistic ( Caller, m, i, "MAXBYTE ", MAX_BYTE_MEM );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
583 TracePoolStatistic ( Caller, m, i, "MAXPART ", MAX_PART_MEM );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
584 TracePoolStatistic ( Caller, m, i, "MAXRANGE", MAX_RANGES );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
585 TracePoolStatistic ( Caller, m, i, "TOTAL ", TOTAL );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
586 #endif /* OPTIMIZE_POOL */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
587 if ( pOversizeStatus->PrimOPC )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
588 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
589 vsi_o_ttrace ( Caller, TC_SYSTEM, "PPM: PARTITION OF SIZE %d USED BY OVERSIZED \
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
590 PRIMITIVE %lx AT %s(%d)", pool_config->part_size,
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
591 pOversizeStatus->PrimOPC, rm_path(pOversizeStatus->Userfile), pPoolStatus->Line);
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
592 OversizeError = TRUE;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
593 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
594 pOversizeStatus++;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
595 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
596 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
597 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
598 break;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
599 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
600 pool_config++;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
601 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
602 if ( !PartitionError )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
603 vsi_o_ttrace ( Caller, TC_SYSTEM, "[PPM]: ALL PARTITIONS FREED" );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
604 if ( !OversizeError )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
605 vsi_o_ttrace ( Caller, TC_SYSTEM, "[PPM]: NO OVERSIZE ERRORS OCCURED" );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
606 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
607 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
608
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
609 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
610 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
611
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
612 #ifndef RUN_INT_RAM
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
613 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
614 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
615 | PROJECT : GSM-Frame (8415) MODULE : VSI_PPM |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
616 | STATE : code ROUTINE : InitializePPM |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
617 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
618
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
619 PURPOSE : initialize supervision, write index to each partition.
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
620
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
621 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
622 void InitializePPM ( void )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
623 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
624 T_FRM_PARTITION_POOL_CONFIG * pool_config;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
625 ULONG *Prims;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
626 USHORT i,j,k,m,n;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
627 int status;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
628 static int last_range = 0;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
629 static int last_cnt = 0;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
630
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
631 status = os_AllocateMemory (NO_TASK, (T_VOID_STRUCT**)&Prims, sizeof(int)*NumberOfPPMPartitions, OS_NO_SUSPEND, ext_data_pool_handle );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
632 status |= os_AllocateMemory (NO_TASK, (T_VOID_STRUCT**)&PoolGroup, sizeof(T_POOL_GROUP)*NumOfPPMPools, OS_NO_SUSPEND, ext_data_pool_handle );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
633 status |= os_AllocateMemory (NO_TASK, (T_VOID_STRUCT**)&PartitionStatus, sizeof(T_PARTITION_STATUS)*NumberOfPPMPartitions, OS_NO_SUSPEND, ext_data_pool_handle );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
634 status |= os_AllocateMemory (NO_TASK, (T_VOID_STRUCT**)&PartitionOversize, sizeof(T_OVERSIZE_STATUS)*NumOfPPMPools, OS_NO_SUSPEND, ext_data_pool_handle );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
635 status |= os_AllocateMemory (NO_TASK, (T_VOID_STRUCT**)&PartitionCounter, sizeof(T_COUNTER)*NumOfPPMPools, OS_NO_SUSPEND, ext_data_pool_handle );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
636 #ifdef OPTIMIZE_POOL
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
637 status |= os_AllocateMemory (NO_TASK, (T_VOID_STRUCT**)&ByteCounter, sizeof(T_COUNTER)*NumOfPPMPools, OS_NO_SUSPEND, ext_data_pool_handle );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
638 status |= os_AllocateMemory (NO_TASK, (T_VOID_STRUCT**)&RangeCounter, sizeof(T_COUNTER)*NumberOfPPMPartitions, OS_NO_SUSPEND, ext_data_pool_handle );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
639 status |= os_AllocateMemory (NO_TASK, (T_VOID_STRUCT**)&GroupStartRange, sizeof(int)*NumOfPPMGroups, OS_NO_SUSPEND, ext_data_pool_handle );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
640 status |= os_AllocateMemory (NO_TASK, (T_VOID_STRUCT**)&GroupStartCnt, sizeof(int)*NumOfPPMGroups, OS_NO_SUSPEND, ext_data_pool_handle );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
641 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
642 if ( status > 0 )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
643 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
644 vsi_o_assert ( 0, OS_SYST_ERR, __FILE__, __LINE__, "Memory allocation for partition supervision failed" );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
645 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
646 ppm_check_partition_owner = 0;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
647 PoolStatus.PartitionStatus = PartitionStatus;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
648 PoolStatus.PartitionOversize = PartitionOversize;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
649 PoolStatus.PartitionCounter = PartitionCounter;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
650 #ifdef OPTIMIZE_POOL
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
651 PoolStatus.ByteCounter = ByteCounter;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
652 PoolStatus.RangeCounter = RangeCounter;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
653 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
654
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
655 for ( j = 0; j<NumberOfPPMPartitions; j++)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
656 Prims[j] = 0;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
657
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
658 for (m = 0, j = 0, i = 0; partition_grp_config[m].grp_config != NULL; m++ )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
659 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
660 if ( strcmp ("TEST", partition_grp_config[m].name ) )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
661 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
662 pool_config = (T_FRM_PARTITION_POOL_CONFIG*)partition_grp_config[m].grp_config;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
663
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
664 for (n = 0; pool_config != NULL; i++, n++)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
665 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
666 if ( pool_config->part_size )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
667 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
668 PoolGroup[i].group_nr = m;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
669 PoolGroup[i].pool_nr = n;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
670 for (k = 0; k < pool_config->part_num; k++ , j++)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
671 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
672 if ( os_AllocatePartition ( NO_TASK, (T_VOID_STRUCT**)&Prims[j], pool_config->part_size,
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
673 OS_NO_SUSPEND, *PoolGroupHandle[m] ) == OS_OK )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
674 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
675 P_IDX((T_PRIM_HEADER*)(Prims[j]+PPM_IDX_OFFSET)) = ( ((USHORT)i<<16) | j );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
676 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
677 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
678 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
679 P_IDX((T_PRIM_HEADER*)(Prims[j]+PPM_IDX_OFFSET)) = 0;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
680 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
681 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
682 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
683 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
684 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
685 break;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
686 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
687 pool_config++;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
688 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
689 if ( m == 0 )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
690 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
691 GroupStartCnt[m] = 0;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
692 GroupStartRange[m] = 0;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
693 last_cnt = n;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
694 last_range = RANGES_PER_POOL * n;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
695 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
696 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
697 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
698 GroupStartCnt[m] = last_cnt;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
699 GroupStartRange[m] = last_range;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
700 last_cnt = GroupStartCnt[m] + n;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
701 last_range = GroupStartRange[m] + RANGES_PER_POOL * n;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
702 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
703
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
704 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
705 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
706 for ( j = 0; j<NumberOfPPMPartitions; j++)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
707 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
708 if ( Prims[j] )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
709 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
710 os_DeallocatePartition ( NO_TASK, (T_VOID_STRUCT*)Prims[j] );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
711 PoolStatus.PartitionStatus [ P_PNR(Prims[j]+4) ].Status = PARTITION_FREED;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
712 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
713 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
714 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
715 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
716
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
717 #ifndef RUN_FLASH
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
718 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
719 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
720 | PROJECT : GSM-Frame (8415) MODULE : VSI_PPM |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
721 | STATE : code ROUTINE : vsi_ppm_new |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
722 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
723
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
724 PURPOSE : supervision of allocating a partition.
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
725
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
726 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
727 GLOBAL void vsi_ppm_new ( T_HANDLE Caller, ULONG Size, T_PRIM_HEADER *prim, const char* file, int line )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
728 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
729 T_PARTITION_STATUS *pPoolStatus;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
730 USHORT group_nr, pool_nr;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
731
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
732 if ( prim != NULL )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
733 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
734 if ( get_partition_group ( prim, &group_nr, &pool_nr ) == VSI_OK )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
735 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
736 vsi_ppm_setend(prim, Size);
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
737 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
738 * set pointer to status entry of the currently used partition
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
739 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
740 pPoolStatus = &PoolStatus.PartitionStatus [ P_PNR(prim) ];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
741
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
742 pPoolStatus->ptr = prim;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
743 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
744 * send error message in case of an illegal state transition
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
745 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
746 if ( pPoolStatus->Status & FORBIDDEN_ALLOCATE_STATES )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
747 vsi_o_ttrace (Caller, TC_SYSTEM,
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
748 "[PPM]: %s->%s: %s(%d)", get_partition_state_name(pPoolStatus->Status),
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
749 get_partition_state_name(PARTITION_ALLOCATED),rm_path(file),line );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
750
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
751 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
752 * update partition status
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
753 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
754 SetPartitionStatus ( pPoolStatus, file, line, P_OPC(prim), PARTITION_ALLOCATED, Caller );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
755
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
756 #ifdef OPTIMIZE_POOL
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
757 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
758 * get primitive size and update range counter
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
759 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
760 pPoolStatus->UsedSize = Size;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
761 UpdatePoolCounter ( &PoolStatus.RangeCounter [GetPartitionRange(pPoolStatus->UsedSize,group_nr,pool_nr)], INCREMENT,1 );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
762 #endif /* OPTIMIZE_POOL */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
763
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
764 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
765 * update partition counter, if new maximum and OPTIMIZE_POOL, then
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
766 * - store the counters of the ranges within this partition
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
767 * - send a message that a new maximum has occurred
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
768 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
769 if ( UpdatePoolCounter ( &PoolStatus.PartitionCounter [P_PGR(prim)],INCREMENT,1 ) )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
770 #ifndef OPTIMIZE_POOL
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
771 ;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
772 #else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
773 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
774 StoreRangeCounters ( prim, STORE_MAX_PART );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
775 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
776
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
777 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
778 * update byte counter, if new maximum, then
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
779 * - store the counters of the ranges within this partition
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
780 * - store the number of currently allocated partitions
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
781 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
782 if ( UpdatePoolCounter ( &PoolStatus.ByteCounter [P_PGR(prim)],INCREMENT,pPoolStatus->UsedSize ) )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
783 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
784 StoreRangeCounters ( prim, STORE_MAX_BYTE );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
785 UpdatePoolCounter ( &PoolStatus.PartitionCounter [ P_PGR(prim) ], STORE_MAX_BYTE,0 );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
786 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
787 #endif /* OPTIMIZE_POOL */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
788 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
789 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
790 vsi_o_ttrace (Caller, TC_SYSTEM,"[PPM]: Invalid Partition Pool, group: %d, pool: %d", group_nr, pool_nr );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
791 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
792 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
793 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
794
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
795 #ifndef RUN_FLASH
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
796 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
797 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
798 | PROJECT : GSM-Frame (8415) MODULE : VSI_PPM |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
799 | STATE : code ROUTINE : vsi_ppm_rec |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
800 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
801
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
802 PURPOSE : supervision of receiving a partition.
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
803
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
804 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
805 GLOBAL void vsi_ppm_rec ( T_HANDLE Caller, T_PRIM_HEADER *prim, const char *file, int line )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
806 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
807 T_PARTITION_STATUS *pPoolStatus;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
808 USHORT group_nr, pool_nr;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
809
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
810 if ( prim != NULL )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
811 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
812 if ( get_partition_group ( prim, &group_nr, &pool_nr ) == VSI_OK )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
813 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
814 Caller = e_running[os_MyHandle()];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
815 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
816 * set pointer to status entry of the currently used partition
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
817 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
818 pPoolStatus = &PoolStatus.PartitionStatus [ P_PNR(prim) ];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
819
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
820 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
821 * send error message in case of an illegal state transition
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
822 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
823 if ( pPoolStatus->Status & FORBIDDEN_RECEIVE_STATES )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
824 vsi_o_ttrace (Caller, TC_SYSTEM,
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
825 "[PPM]: %s->%s: %s(%d)", get_partition_state_name(pPoolStatus->Status),
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
826 get_partition_state_name(PARTITION_RECEIVED),rm_path(file),line );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
827
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
828 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
829 * update partition status
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
830 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
831 SetPartitionStatus ( pPoolStatus, file, line, P_OPC(prim), PARTITION_RECEIVED, Caller );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
832 update_dyn_state ( Caller, prim, Caller, PARTITION_RECEIVED, file, line );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
833 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
834 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
835 vsi_o_ttrace (Caller, TC_SYSTEM,"[PPM]: Invalid Partition Pool, group: %d, pool: %d", group_nr, pool_nr );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
836 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
837 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
838 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
839
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
840 #ifndef RUN_INT_RAM
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
841 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
842 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
843 | PROJECT : GSM-Frame (8415) MODULE : VSI_PPM |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
844 | STATE : code ROUTINE : vsi_ppm_access |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
845 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
846
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
847 PURPOSE : supervision of receiving a partition.
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
848
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
849 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
850 GLOBAL void vsi_ppm_access ( T_HANDLE Caller, T_PRIM_HEADER *prim, const char *file, int line )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
851 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
852 T_PARTITION_STATUS *pPoolStatus;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
853 USHORT group_nr, pool_nr;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
854
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
855 if ( prim != NULL )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
856 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
857 if ( get_partition_group ( prim, &group_nr, &pool_nr ) == VSI_OK )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
858 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
859 Caller = e_running[os_MyHandle()];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
860 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
861 * set pointer to status entry of the currently used partition
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
862 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
863 pPoolStatus = &PoolStatus.PartitionStatus [ P_PNR(prim) ];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
864
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
865 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
866 * send error message in case of an illegal state transition
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
867 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
868 if ( pPoolStatus->Status & FORBIDDEN_ACCESS_STATES )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
869 vsi_o_ttrace (Caller, TC_SYSTEM,
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
870 "[PPM]: %s->%s: %s(%d)", get_partition_state_name(pPoolStatus->Status),
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
871 get_partition_state_name(PARTITION_ACCESSED),rm_path(file),line );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
872
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
873 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
874 * update partition status
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
875 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
876 SetPartitionStatus ( pPoolStatus, file, line, P_OPC(prim), pPoolStatus->Status, Caller );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
877 update_dyn_state ( Caller, prim, Caller, PARTITION_ACCESSED, file, line );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
878 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
879 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
880 vsi_o_ttrace (Caller, TC_SYSTEM,"[PPM]: Invalid Partition Pool, group: %d, pool: %d", group_nr, pool_nr );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
881 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
882 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
883 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
884
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
885 #ifndef RUN_FLASH
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
886 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
887 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
888 | PROJECT : GSM-Frame (8415) MODULE : VSI_PPM |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
889 | STATE : code ROUTINE : vsi_ppm_send |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
890 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
891
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
892 PURPOSE : supervision of receiving a partition.
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
893
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
894 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
895 GLOBAL void vsi_ppm_send ( T_HANDLE Caller, T_HANDLE rcv, T_PRIM_HEADER *prim, const char *file, int line )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
896 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
897 T_PARTITION_STATUS *pPoolStatus;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
898 USHORT NewStatus = PARTITION_SENT;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
899 USHORT group_nr, pool_nr;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
900
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
901 if ( prim != NULL )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
902 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
903 if ( get_partition_group ( prim, &group_nr, &pool_nr ) == VSI_OK )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
904 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
905 Caller = e_running[os_MyHandle()];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
906 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
907 * set pointer to status entry of the currently used partition
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
908 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
909 pPoolStatus = &PoolStatus.PartitionStatus [ P_PNR(prim) ];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
910
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
911
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
912 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
913 * send error message in case of an illegal state transition
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
914 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
915 if ( pPoolStatus->Status & FORBIDDEN_SEND_STATES )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
916 vsi_o_ttrace (Caller, TC_SYSTEM,
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
917 "[PPM]: %s->%s: %s(%d)", get_partition_state_name(pPoolStatus->Status),
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
918 get_partition_state_name(PARTITION_SENT),rm_path(file),line );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
919
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
920 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
921 * check if more bytes written than requested during allocation
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
922 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
923 if ( *((char*)prim + pPoolStatus->RequestedSize - 1) != PPM_END_MARKER )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
924 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
925 if ( prim->dph_offset == 0 )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
926 vsi_o_ttrace ( NO_TASK, TC_SYSTEM, "SYSTEM WARNING: Bytes written > requested partition size, %s(%d)", rm_path(file), line );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
927 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
928 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
929 * update partition status
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
930 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
931 SetPartitionStatus ( pPoolStatus, file, line, P_OPC(prim), NewStatus, (T_HANDLE)(OWNER_IS_COM_HANDLE|rcv) );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
932 update_dyn_state ( Caller, prim, rcv, PARTITION_SENT, file, line );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
933 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
934 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
935 vsi_o_ttrace (Caller, TC_SYSTEM,"[PPM]: Invalid Partition Pool, group: %d, pool: %d", group_nr, pool_nr );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
936 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
937 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
938 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
939
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
940 #ifndef RUN_INT_RAM
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
941 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
942 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
943 | PROJECT : GSM-Frame (8415) MODULE : VSI_PPM |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
944 | STATE : code ROUTINE : vsi_ppm_store |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
945 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
946
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
947 PURPOSE : supervision of storing a partition.
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
948
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
949 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
950 GLOBAL void vsi_ppm_store ( T_HANDLE Caller, T_PRIM_HEADER *prim, const char *file, int line )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
951 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
952 T_PARTITION_STATUS *pPoolStatus;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
953 USHORT group_nr, pool_nr;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
954
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
955 if ( prim != NULL )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
956 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
957 if ( get_partition_group ( prim, &group_nr, &pool_nr ) == VSI_OK )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
958 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
959 Caller = e_running[os_MyHandle()];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
960 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
961 * set pointer to status entry of the currently used partition
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
962 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
963 pPoolStatus = &PoolStatus.PartitionStatus [ P_PNR(prim) ];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
964
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
965 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
966 * send error message in case of an illegal state transition
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
967 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
968 if ( pPoolStatus->Status & FORBIDDEN_STORE_STATES )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
969 vsi_o_ttrace (Caller, TC_SYSTEM,
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
970 "[PPM]: %s->%s: %s(%d)", get_partition_state_name(pPoolStatus->Status),
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
971 get_partition_state_name(PARTITION_STORED),rm_path(file),line );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
972
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
973 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
974 * update partition status
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
975 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
976 SetPartitionStatus ( pPoolStatus, file, line, P_OPC(prim), pPoolStatus->Status, Caller );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
977 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
978 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
979 vsi_o_ttrace (Caller, TC_SYSTEM,"[PPM]: Invalid Partition Pool, group: %d, pool: %d", group_nr, pool_nr );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
980 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
981 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
982 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
983
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
984 #ifndef RUN_INT_RAM
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
985 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
986 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
987 | PROJECT : GSM-Frame (8415) MODULE : VSI_PPM |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
988 | STATE : code ROUTINE : vsi_ppm_reuse |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
989 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
990
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
991 PURPOSE : supervision of reusing a partition.
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
992
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
993 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
994 GLOBAL void vsi_ppm_reuse ( T_HANDLE Caller, T_PRIM_HEADER *prim, const char *file, int line )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
995 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
996 T_PARTITION_STATUS *pPoolStatus;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
997 ULONG OldSize, NewSize;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
998 USHORT group_nr, pool_nr;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
999
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1000 if ( prim != NULL )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1001 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1002 if ( get_partition_group ( prim, &group_nr, &pool_nr ) == VSI_OK )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1003 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1004 Caller = e_running[os_MyHandle()];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1005 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1006 * set pointer to status entry of the currently used partition
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1007 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1008 pPoolStatus = &PoolStatus.PartitionStatus [ P_PNR(prim) ];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1009
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1010 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1011 * send error message in case of an illegal state transition
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1012 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1013 if ( pPoolStatus->Status & FORBIDDEN_REUSE_STATES )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1014 vsi_o_ttrace (Caller, TC_SYSTEM,
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1015 "[PPM]: %s->%s: %s(%d)", get_partition_state_name(pPoolStatus->Status),
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1016 get_partition_state_name(PARTITION_REUSED),rm_path(file),line );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1017
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1018 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1019 * update partition status
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1020 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1021 SetPartitionStatus ( pPoolStatus, file, line, P_OPC(prim), PARTITION_REUSED, Caller );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1022 update_dyn_state ( Caller, prim, Caller, PARTITION_REUSED, file, line );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1023 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1024 * if the new primitive exceeds the size of the partition, then
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1025 * - store file, line and primitive opc
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1026 * - send an error message
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1027 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1028 #if 0
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1029 if ( (ULONG)(P_LEN(prim)) > PoolGroupConfig[PrimGroupHandle]->PoolConfig[P_PGR(prim)].PartitionSize )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1030 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1031 PoolStatus.PartitionOversize [P_PGR(prim)].Userfile = file;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1032 PoolStatus.PartitionOversize [P_PGR(prim)].Line = line;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1033 PoolStatus.PartitionOversize [P_PGR(prim)].PrimOPC = P_OPC(prim);
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1034 vsi_o_assert (NO_TASK, OS_SYST_ERR_OVERSIZE, file, line, "PREUSE - oversize error in %s",
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1035 pf_TaskTable[Caller].Name );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1036 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1037 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1038 #ifdef OPTIMIZE_POOL
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1039 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1040 * if the old and new primitve have different sizes, then
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1041 * - decrement byte counter by old size
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1042 * - decrement old range counter
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1043 * - increment new range counter
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1044 * - increment byte counter by new size
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1045 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1046 if ( (OldSize=pPoolStatus->UsedSize) NEQ (NewSize=P_LEN(prim)) )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1047 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1048 UpdatePoolCounter ( &PoolStatus.ByteCounter [P_PGR(prim)],DECREMENT,OldSize );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1049 UpdatePoolCounter ( &PoolStatus.RangeCounter [ GetPartitionRange(OldSize,group_nr,pool_nr) ], DECREMENT, 1 );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1050 UpdatePoolCounter ( &PoolStatus.RangeCounter [ GetPartitionRange(NewSize,group_nr,pool_nr) ], INCREMENT, 1 );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1051 pPoolStatus->UsedSize = NewSize;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1052 if ( UpdatePoolCounter ( &PoolStatus.ByteCounter [P_PGR(prim)],INCREMENT,NewSize ) )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1053 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1054 StoreRangeCounters ( prim, STORE_MAX_BYTE );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1055 UpdatePoolCounter ( &PoolStatus.PartitionCounter [ P_PGR(prim) ], STORE_MAX_BYTE,0 );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1056 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1057 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1058 #endif /* OPTIMIZE_POOL */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1059 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1060 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1061 vsi_o_ttrace (Caller, TC_SYSTEM,"[PPM]: Invalid Partition Pool, group: %d, pool: %d", group_nr, pool_nr );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1062 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1063 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1064 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1065
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1066 #ifndef RUN_FLASH
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1067 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1068 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1069 | PROJECT : GSM-Frame (8415) MODULE : VSI_PPM |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1070 | STATE : code ROUTINE : vsi_ppm_free |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1071 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1072
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1073 PURPOSE : supervision of deallocating a partition.
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1074
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1075 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1076 GLOBAL void vsi_ppm_free ( T_HANDLE Caller, T_PRIM_HEADER *prim, const char *file, int line )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1077 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1078 T_PARTITION_STATUS *pPoolStatus;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1079 USHORT group_nr, pool_nr;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1080 T_HANDLE owner;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1081
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1082 if ( prim != NULL )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1083 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1084 if ( get_partition_group ( prim, &group_nr, &pool_nr ) == VSI_OK )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1085 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1086 Caller = e_running[os_MyHandle()];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1087 prim->opc = 0;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1088 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1089 * set pointer to status entry of the currently used partition
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1090 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1091 pPoolStatus = &PoolStatus.PartitionStatus [ P_PNR(prim) ];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1092
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1093 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1094 * send error message in case of an illegal state transition
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1095 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1096 if ( pPoolStatus->Status & FORBIDDEN_DEALLOCATE_STATES )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1097 vsi_o_ttrace (Caller, TC_SYSTEM,
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1098 "[PPM]: %s->%s: %s(%d)", get_partition_state_name(pPoolStatus->Status),
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1099 get_partition_state_name(PARTITION_FREED),file,line );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1100
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1101
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1102 /* CURRENTLY DISABLED FOR UMTS RELEASE */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1103 if ( pPoolStatus->owner & OWNER_IS_COM_HANDLE )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1104 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1105 owner = pPoolStatus->owner&~OWNER_IS_COM_HANDLE;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1106 vsi_o_ttrace (NO_TASK, TC_SYSTEM,
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1107 "SYSTEM WARNING: %s freed partition stored in %s queue, %s(%d)",
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1108 pf_TaskTable[Caller].Name,pf_TaskTable[owner].Name,rm_path(file),line );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1109 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1110 if ( ppm_check_partition_owner == 1 )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1111 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1112 if ( (pPoolStatus->owner & ~OWNER_IS_COM_HANDLE) != Caller )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1113 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1114 owner = pPoolStatus->owner&~OWNER_IS_COM_HANDLE;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1115 vsi_o_ttrace (NO_TASK, TC_SYSTEM,
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1116 "SYSTEM WARNING: %s freed partition belonging to %s, %s(%d)",
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1117 pf_TaskTable[Caller].Name,pf_TaskTable[owner].Name,rm_path(file),line );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1118 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1119 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1120
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1121 if ( !(pPoolStatus->Status & PARTITION_FREED) )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1122 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1123 #ifdef OPTIMIZE_POOL
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1124 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1125 * decrement byte counter by primitive size
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1126 * decrement range counter
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1127 * decrement partition counter
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1128 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1129 UpdatePoolCounter ( &PoolStatus.ByteCounter [ P_PGR(prim) ], DECREMENT, pPoolStatus->UsedSize );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1130 UpdatePoolCounter ( &PoolStatus.RangeCounter [GetPartitionRange(pPoolStatus->UsedSize,group_nr,pool_nr)], DECREMENT, 1 ) ;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1131 #endif /* OPTIMIZE_POOL */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1132 UpdatePoolCounter ( &PoolStatus.PartitionCounter [ P_PGR(prim) ], DECREMENT, 1 );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1133 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1134
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1135 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1136 * update partition status
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1137 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1138 SetPartitionStatus ( pPoolStatus, file, line, 0, PARTITION_FREED, 0 );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1139 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1140 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1141 vsi_o_ttrace (Caller, TC_SYSTEM,"[PPM]: Invalid Partition Pool, group: %d, pool: %d", group_nr, pool_nr );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1142 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1143 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1144 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1145
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1146 #ifndef RUN_FLASH
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1147 GLOBAL void vsi_ppm_setend ( T_PRIM_HEADER *prim, ULONG size )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1148 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1149 *((char*)prim + size ) = PPM_END_MARKER;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1150 PoolStatus.PartitionStatus[P_PNR(prim)].RequestedSize = size+1;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1151 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1152 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1153 #endif /* MEMORY_SUPERVISION */