|
@@ -79,8 +79,10 @@ void * alloc_base_memory ( size_t size ) {
|
79
|
79
|
*/
|
80
|
80
|
memset ( ptr, 0, size_kb << 10 );
|
81
|
81
|
|
82
|
|
- DBG ( "Allocated %d kB of base memory at [%hx:0000,%hx:0000)\n",
|
83
|
|
- size_kb, ( fbms << 6 ), ( ( fbms + size_kb ) << 6 ) );
|
|
82
|
+ DBG ( "Allocated %d kB of base memory at [%hx:0000,%hx:0000), "
|
|
83
|
+ "%d kB now free\n", size_kb,
|
|
84
|
+ ( virt_to_phys ( ptr ) >> 4 ),
|
|
85
|
+ ( ( virt_to_phys ( ptr ) + ( size_kb << 10 ) ) >> 4 ), fbms );
|
84
|
86
|
|
85
|
87
|
/* Update our memory map */
|
86
|
88
|
get_memsizes();
|
|
@@ -113,9 +115,11 @@ void free_base_memory ( void *ptr, size_t size ) {
|
113
|
115
|
return;
|
114
|
116
|
}
|
115
|
117
|
|
116
|
|
- DBG ( "Trying to free %d bytes base memory at %hx:%hx\n", size,
|
|
118
|
+ DBG ( "Trying to free %d bytes base memory at %hx:%hx "
|
|
119
|
+ "from %d kB free\n", size,
|
117
|
120
|
( virt_to_phys ( ptr - remainder ) >> 4 ),
|
118
|
|
- ( virt_to_phys ( ptr - remainder ) & 0xf ) + remainder );
|
|
121
|
+ ( virt_to_phys ( ptr - remainder ) & 0xf ) + remainder,
|
|
122
|
+ fbms );
|
119
|
123
|
|
120
|
124
|
/* Mark every kilobyte within this block as free. This is
|
121
|
125
|
* overkill for normal purposes, but helps when something has
|
|
@@ -142,8 +146,6 @@ void free_base_memory ( void *ptr, size_t size ) {
|
142
|
146
|
|
143
|
147
|
/* Update our memory map */
|
144
|
148
|
get_memsizes();
|
145
|
|
-
|
146
|
|
- DBG ( "%d kB of base memory now free\n", fbms );
|
147
|
149
|
}
|
148
|
150
|
|
149
|
151
|
/* Do the actual freeing of memory. This is split out from
|
|
@@ -173,9 +175,13 @@ static void free_unused_base_memory ( void ) {
|
173
|
175
|
/* Return memory to BIOS */
|
174
|
176
|
fbms += free_block->size_kb;
|
175
|
177
|
|
176
|
|
- DBG ( "Freed %d kB of base memory at [%hx:0000,%hx:0000)\n",
|
177
|
|
- free_block->size_kb, ( fbms << 6 ),
|
178
|
|
- ( fbms + free_block->size_kb ) << 6 );
|
|
178
|
+ DBG ( "Freed %d kB of base memory at [%hx:0000,%hx:0000), "
|
|
179
|
+ "%d kB now free\n",
|
|
180
|
+ free_block->size_kb,
|
|
181
|
+ ( virt_to_phys ( free_block ) >> 4 ),
|
|
182
|
+ ( ( virt_to_phys ( free_block ) +
|
|
183
|
+ ( free_block->size_kb << 10 ) ) >> 4 ),
|
|
184
|
+ fbms );
|
179
|
185
|
|
180
|
186
|
/* Do not zero out the freed block, because it might
|
181
|
187
|
* be the one containing librm, in which case we're
|