[syslinux:lwip] PXE Cleanups, allow for 128 open files

syslinux-bot for H. Peter Anvin hpa at zytor.com
Mon Apr 25 11:51:44 PDT 2011


Commit-ID:  9ca79e92e60dd243c60e257a2dc60ba7b3677f37
Gitweb:     http://syslinux.zytor.com/commit/9ca79e92e60dd243c60e257a2dc60ba7b3677f37
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Mon, 25 Apr 2011 11:46:56 -0700
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Mon, 25 Apr 2011 11:46:56 -0700

PXE Cleanups, allow for 128 open files

Clean up dead code in the PXE stack.

The buffer assignment no longer limits the number of open files
either, so raise it to something more than reasonable.

Signed-off-by: H. Peter Anvin <hpa at zytor.com>


---
 com32/lib/sys/file.h |    2 +-
 core/fs/pxe/pxe.h    |   16 ++--------------
 core/include/fs.h    |    7 ++-----
 3 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/com32/lib/sys/file.h b/com32/lib/sys/file.h
index e984f16..12518a8 100644
--- a/com32/lib/sys/file.h
+++ b/com32/lib/sys/file.h
@@ -74,7 +74,7 @@ struct output_dev {
 
 /* File structure */
 
-#define NFILES 32		/* Number of files to support */
+#define NFILES 128		/* Number of files to support */
 #define MAXBLOCK 16384		/* Defined by ABI */
 
 struct file_info {
diff --git a/core/fs/pxe/pxe.h b/core/fs/pxe/pxe.h
index 24a8642..8228def 100644
--- a/core/fs/pxe/pxe.h
+++ b/core/fs/pxe/pxe.h
@@ -21,27 +21,15 @@
 #define PXE_H
 
 #include <syslinux/pxe_api.h>
-#include "fs.h"			/* For MAX_OPEN, should go away */
+#include "fs.h"			/* Mostly for FILENAME_MAX */
 
 /*
  * Some basic defines...
  */
-#define PKTBUF_SIZE     2048			/*  */
+#define PKTBUF_SIZE     2048	/* Used mostly by the gPXE backend */
 
 #define is_digit(c)     (((c) >= '0') && ((c) <= '9'))
 
-static inline bool is_hex(char c)
-{
-    return (c >= '0' && c <= '9') ||
-	(c >= 'A' && c <= 'F') ||
-	(c >= 'a' && c <= 'f');
-}
-
-static inline int hexval(char c)
-{
-    return (c >= 'A') ? (c & ~0x20) - 'A' + 10 : (c - '0');
-}
-
 #define BOOTP_OPTION_MAGIC  htonl(0x63825363)
 #define MAC_MAX 32
 
diff --git a/core/include/fs.h b/core/include/fs.h
index ecd148d..4301481 100644
--- a/core/include/fs.h
+++ b/core/include/fs.h
@@ -11,12 +11,9 @@
 #include "disk.h"
 
 /*
- * Maximum number of open files.  This is *currently* constrained by the
- * fact that PXE needs to be able to fit all its packet buffers into a
- * 64K segment; this should be fixed by moving the packet buffers to high
- * memory.
+ * Maximum number of open files.
  */
-#define MAX_OPEN_LG2	5
+#define MAX_OPEN_LG2	7
 #define MAX_OPEN	(1 << MAX_OPEN_LG2)
 
 #define FILENAME_MAX_LG2 8



More information about the Syslinux-commits mailing list