|
@@ -20,7 +20,7 @@
|
20
|
20
|
#include <string.h>
|
21
|
21
|
#include <errno.h>
|
22
|
22
|
#include <assert.h>
|
23
|
|
-#include <io.h>
|
|
23
|
+#include <gpxe/uaccess.h>
|
24
|
24
|
#include <gpxe/buffer.h>
|
25
|
25
|
|
26
|
26
|
/** @file
|
|
@@ -49,7 +49,7 @@
|
49
|
49
|
* block consists of the 1025th byte.
|
50
|
50
|
*
|
51
|
51
|
* Note that the rather convoluted way of manipulating the buffer
|
52
|
|
- * descriptors (using copy_{to,from}_phys rather than straightforward
|
|
52
|
+ * descriptors (using copy_{to,from}_user rather than straightforward
|
53
|
53
|
* pointers) is needed to cope with operation as a PXE stack, when we
|
54
|
54
|
* may be running in real mode or 16-bit protected mode, and therefore
|
55
|
55
|
* cannot directly access arbitrary areas of memory using simple
|
|
@@ -97,7 +97,7 @@ static int get_next_free_block ( struct buffer *buffer,
|
97
|
97
|
block->next = block->end = buffer->len;
|
98
|
98
|
} else {
|
99
|
99
|
/* Retrieve block descriptor */
|
100
|
|
- copy_from_phys ( block, ( buffer->addr + block->start ),
|
|
100
|
+ copy_from_user ( block, buffer->addr, block->start,
|
101
|
101
|
sizeof ( *block ) );
|
102
|
102
|
}
|
103
|
103
|
|
|
@@ -115,8 +115,7 @@ static void store_free_block ( struct buffer *buffer,
|
115
|
115
|
size_t free_block_size = ( block->end - block->start );
|
116
|
116
|
|
117
|
117
|
assert ( free_block_size >= sizeof ( *block ) );
|
118
|
|
- copy_to_phys ( ( buffer->addr + block->start ), block,
|
119
|
|
- sizeof ( *block ) );
|
|
118
|
+ copy_to_user ( buffer->addr, block->start, block, sizeof ( *block ) );
|
120
|
119
|
}
|
121
|
120
|
|
122
|
121
|
/**
|
|
@@ -230,7 +229,7 @@ int fill_buffer ( struct buffer *buffer, const void *data,
|
230
|
229
|
}
|
231
|
230
|
|
232
|
231
|
/* Copy data into buffer */
|
233
|
|
- copy_to_phys ( ( buffer->addr + data_start ), data, len );
|
|
232
|
+ copy_to_user ( buffer->addr, data_start, data, len );
|
234
|
233
|
|
235
|
234
|
return 0;
|
236
|
235
|
}
|