summaryrefslogtreecommitdiffstats
path: root/src/arch/x86/image/pxe_image.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86/image/pxe_image.c')
-rw-r--r--src/arch/x86/image/pxe_image.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/arch/x86/image/pxe_image.c b/src/arch/x86/image/pxe_image.c
index b6bcb18b4..f88eadc09 100644
--- a/src/arch/x86/image/pxe_image.c
+++ b/src/arch/x86/image/pxe_image.c
@@ -30,10 +30,10 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
*
*/
+#include <string.h>
#include <pxe.h>
#include <pxe_call.h>
#include <pic8259.h>
-#include <ipxe/uaccess.h>
#include <ipxe/image.h>
#include <ipxe/segment.h>
#include <ipxe/netdevice.h>
@@ -54,24 +54,24 @@ const char *pxe_cmdline;
* @ret rc Return status code
*/
static int pxe_exec ( struct image *image ) {
- userptr_t buffer = real_to_user ( 0, 0x7c00 );
+ void *buffer = real_to_virt ( 0, 0x7c00 );
struct net_device *netdev;
int rc;
/* Verify and prepare segment */
if ( ( rc = prep_segment ( buffer, image->len, image->len ) ) != 0 ) {
- DBGC ( image, "IMAGE %p could not prepare segment: %s\n",
- image, strerror ( rc ) );
+ DBGC ( image, "IMAGE %s could not prepare segment: %s\n",
+ image->name, strerror ( rc ) );
return rc;
}
/* Copy image to segment */
- memcpy_user ( buffer, 0, image->data, 0, image->len );
+ memcpy ( buffer, image->data, image->len );
/* Arbitrarily pick the most recently opened network device */
if ( ( netdev = last_opened_netdev() ) == NULL ) {
- DBGC ( image, "IMAGE %p could not locate PXE net device\n",
- image );
+ DBGC ( image, "IMAGE %s could not locate PXE net device\n",
+ image->name );
return -ENODEV;
}
netdev_get ( netdev );
@@ -142,7 +142,7 @@ int pxe_probe ( struct image *image ) {
* @ret rc Return status code
*/
int pxe_probe_no_mz ( struct image *image ) {
- uint16_t magic;
+ const uint16_t *magic;
int rc;
/* Probe PXE image */
@@ -152,11 +152,11 @@ int pxe_probe_no_mz ( struct image *image ) {
/* Reject image with an "MZ" signature which may indicate an
* EFI image incorrectly handed out to a BIOS system.
*/
- if ( image->len >= sizeof ( magic ) ) {
- copy_from_user ( &magic, image->data, 0, sizeof ( magic ) );
- if ( magic == cpu_to_le16 ( EFI_IMAGE_DOS_SIGNATURE ) ) {
- DBGC ( image, "IMAGE %p may be an EFI image\n",
- image );
+ if ( image->len >= sizeof ( *magic ) ) {
+ magic = image->data;
+ if ( *magic == cpu_to_le16 ( EFI_IMAGE_DOS_SIGNATURE ) ) {
+ DBGC ( image, "IMAGE %s may be an EFI image\n",
+ image->name );
return -ENOTTY;
}
}