[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 13/14] pc-bios/s390-ccw: Allow loading to addres
From: |
Thomas Huth |
Subject: |
[Qemu-devel] [RFC PATCH 13/14] pc-bios/s390-ccw: Allow loading to address 0 |
Date: |
Tue, 27 Jun 2017 13:48:19 +0200 |
Kernels are normally loaded to address 0, so the check for NULL
in the TFTP code has to be replaced.
Signed-off-by: Thomas Huth <address@hidden>
---
pc-bios/s390-ccw/libnet/tftp.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/pc-bios/s390-ccw/libnet/tftp.c b/pc-bios/s390-ccw/libnet/tftp.c
index 34f448c..108092b 100644
--- a/pc-bios/s390-ccw/libnet/tftp.c
+++ b/pc-bios/s390-ccw/libnet/tftp.c
@@ -26,6 +26,7 @@
#define MAX_BLOCKSIZE 1428
#define BUFFER_LEN 256
+#define INVALID_BUFFER ((void *)-1L)
#define ENOTFOUND 1
#define EACCESS 2
@@ -45,7 +46,7 @@
/* Local variables */
static unsigned char packet[BUFFER_LEN];
-static unsigned char *buffer = NULL;
+static unsigned char *buffer = INVALID_BUFFER;
static unsigned short block;
static unsigned short blocksize;
static char blocksize_str[6]; /* Blocksize string for read request */
@@ -337,7 +338,7 @@ int32_t handle_tftp(int fd, uint8_t *pkt, int32_t
packetsize)
struct tftphdr *tftp;
/* buffer is only set if we are handling TFTP */
- if (buffer == NULL )
+ if (buffer == INVALID_BUFFER)
return 0;
#ifndef __DEBUG__
@@ -536,7 +537,7 @@ int tftp(filename_ip_t * _fn_ip, unsigned char *_buffer,
int _len,
printf(" Receiving data: ");
print_progress(-1, 0);
- // Setting buffer to a non-zero address enabled handling of received
TFTP packets.
+ /* Set buffer to a valid address, enables handling of received packets
*/
buffer = _buffer;
set_timer(TICKS_SEC);
@@ -579,8 +580,8 @@ int tftp(filename_ip_t * _fn_ip, unsigned char *_buffer,
int _len,
}
}
- // Setting buffer to NULL disables handling of received TFTP packets.
- buffer = NULL;
+ /* Setting buffer invalid to disable handling of received packets */
+ buffer = INVALID_BUFFER;
if (tftp_errno)
return tftp_errno;
--
1.8.3.1
- [Qemu-devel] [RFC PATCH 06/14] libnet: Remove remainders of netsave code, (continued)
- [Qemu-devel] [RFC PATCH 06/14] libnet: Remove remainders of netsave code, Thomas Huth, 2017/06/27
- [Qemu-devel] [RFC PATCH 01/14] pc-bios/s390-ccw: Add the libc from the SLOF firmware, Thomas Huth, 2017/06/27
- [Qemu-devel] [RFC PATCH 07/14] libnet: Rework error message printing, Thomas Huth, 2017/06/27
- [Qemu-devel] [RFC PATCH 08/14] libnet: Refactor some code of netload() into a separate function, Thomas Huth, 2017/06/27
- [Qemu-devel] [RFC PATCH 10/14] pc-bios/s390-ccw: Add timer code for the libnet, Thomas Huth, 2017/06/27
- [Qemu-devel] [RFC PATCH 11/14] pc-bios/s390-ccw: Add virtio-net driver code, Thomas Huth, 2017/06/27
- [Qemu-devel] [RFC PATCH 09/14] pc-bios/s390-ccw: Make the basic libnet code compilable, Thomas Huth, 2017/06/27
- [Qemu-devel] [RFC PATCH 12/14] pc-bios/s390-ccw: Load file via an intermediate .INS file, Thomas Huth, 2017/06/27
- [Qemu-devel] [RFC PATCH 13/14] pc-bios/s390-ccw: Allow loading to address 0,
Thomas Huth <=
- [Qemu-devel] [RFC PATCH 14/14] pc-bios/s390-ccw: Wire up the netload code, Thomas Huth, 2017/06/27
- [Qemu-devel] [RFC PATCH 05/14] pc-bios/s390-ccw: Add the TFTP network loading stack from SLOF, Thomas Huth, 2017/06/27
- Re: [Qemu-devel] [RFC PATCH 00/14] Implement network booting directly into the s390-ccw BIOS, Farhan Ali, 2017/06/27
- Re: [Qemu-devel] [RFC PATCH 00/14] Implement network booting directly into the s390-ccw BIOS, Viktor Mihajlovski, 2017/06/27