|
@@ -160,8 +160,10 @@ int fill_buffer ( struct buffer *buffer, const void *data,
|
160
|
160
|
int rc;
|
161
|
161
|
|
162
|
162
|
DBGC ( buffer, "BUFFER %p [%lx,%lx) filling portion [%lx,%lx)\n",
|
163
|
|
- buffer, buffer->addr, ( buffer->addr + buffer->len ),
|
164
|
|
- ( buffer->addr + data_start ), ( buffer->addr + data_end ) );
|
|
163
|
+ buffer, user_to_phys ( buffer->addr, 0 ),
|
|
164
|
+ user_to_phys ( buffer->addr, buffer->len ),
|
|
165
|
+ user_to_phys ( buffer->addr, data_start ),
|
|
166
|
+ user_to_phys ( buffer->addr, data_end ) );
|
165
|
167
|
|
166
|
168
|
/* Check that block fits within buffer, expand if necessary */
|
167
|
169
|
if ( data_end > buffer->len ) {
|
|
@@ -175,7 +177,8 @@ int fill_buffer ( struct buffer *buffer, const void *data,
|
175
|
177
|
return rc;
|
176
|
178
|
}
|
177
|
179
|
DBGC ( buffer, "BUFFER %p expanded to [%lx,%lx)\n", buffer,
|
178
|
|
- buffer->addr, ( buffer->addr + buffer->len ) );
|
|
180
|
+ user_to_phys ( buffer->addr, 0 ),
|
|
181
|
+ user_to_phys ( buffer->addr, buffer->len ) );
|
179
|
182
|
assert ( buffer->len >= data_end );
|
180
|
183
|
}
|
181
|
184
|
|
|
@@ -202,16 +205,17 @@ int fill_buffer ( struct buffer *buffer, const void *data,
|
202
|
205
|
before.next = after.start;
|
203
|
206
|
|
204
|
207
|
DBGC ( buffer, "BUFFER %p split before [%lx,%lx) after [%lx,%lx)\n",
|
205
|
|
- buffer, ( buffer->addr + before.start ),
|
206
|
|
- ( buffer->addr + before.end ), ( buffer->addr + after.start ),
|
207
|
|
- ( buffer->addr + after.end ) );
|
|
208
|
+ buffer, user_to_phys ( buffer->addr, before.start ),
|
|
209
|
+ user_to_phys ( buffer->addr, before.end ),
|
|
210
|
+ user_to_phys ( buffer->addr, after.start ),
|
|
211
|
+ user_to_phys ( buffer->addr, after.end ) );
|
208
|
212
|
|
209
|
213
|
/* Write back 'before' block, if any */
|
210
|
214
|
if ( before.end == 0 ) {
|
211
|
215
|
/* No 'before' block: update buffer->fill */
|
212
|
216
|
buffer->fill = after.start;
|
213
|
217
|
DBGC ( buffer, "BUFFER %p full up to %lx\n", buffer,
|
214
|
|
- ( buffer->addr + buffer->fill ) );
|
|
218
|
+ user_to_phys ( buffer->addr, buffer->fill ) );
|
215
|
219
|
} else {
|
216
|
220
|
/* Write back 'before' block */
|
217
|
221
|
store_free_block ( buffer, &before );
|
|
@@ -222,7 +226,7 @@ int fill_buffer ( struct buffer *buffer, const void *data,
|
222
|
226
|
/* 'After' block is the final block: update buffer->free */
|
223
|
227
|
buffer->free = after.start;
|
224
|
228
|
DBGC ( buffer, "BUFFER %p free from %lx onwards\n", buffer,
|
225
|
|
- ( buffer->addr + buffer->free ) );
|
|
229
|
+ user_to_phys ( buffer->addr, buffer->free ) );
|
226
|
230
|
} else {
|
227
|
231
|
/* Write back 'after' block */
|
228
|
232
|
store_free_block ( buffer, &after );
|