summaryrefslogtreecommitdiff
path: root/com32/lib/syslinux
diff options
context:
space:
mode:
authorMichal Soltys <soltys@ziu.info>2011-03-07 23:47:31 +0100
committerMichal Soltys <soltys@ziu.info>2011-03-07 23:47:31 +0100
commit6b905c1968fe16007c9f446c7a1b1e71419767c7 (patch)
treec4abae0ecd039470ae9b3d1bc54ab758b546e9e1 /com32/lib/syslinux
parentb9cc8bc0b6976cc92a21e2a8c8b155048e01d45e (diff)
parentc987272b97ecb89db19ee438dba0c8c2418f8ffe (diff)
downloadsyslinux-6b905c1968fe16007c9f446c7a1b1e71419767c7.tar.gz
Merge branch 'master' into chaindev
Diffstat (limited to 'com32/lib/syslinux')
-rw-r--r--com32/lib/syslinux/load_linux.c37
1 files changed, 1 insertions, 36 deletions
diff --git a/com32/lib/syslinux/load_linux.c b/com32/lib/syslinux/load_linux.c
index df793625..3ac6e5d0 100644
--- a/com32/lib/syslinux/load_linux.c
+++ b/com32/lib/syslinux/load_linux.c
@@ -38,6 +38,7 @@
#include <inttypes.h>
#include <string.h>
#include <minmax.h>
+#include <suffix_number.h>
#include <syslinux/align.h>
#include <syslinux/linux.h>
#include <syslinux/bootrm.h>
@@ -96,42 +97,6 @@ struct linux_header {
#define LOAD_HIGH 0x01
#define CAN_USE_HEAP 0x80
-/* Get a value with a potential suffix (k/m/g/t/p/e) */
-static unsigned long long suffix_number(const char *str)
-{
- char *ep;
- unsigned long long v;
- int shift;
-
- v = strtoull(str, &ep, 0);
- switch (*ep | 0x20) {
- case 'k':
- shift = 10;
- break;
- case 'm':
- shift = 20;
- break;
- case 'g':
- shift = 30;
- break;
- case 't':
- shift = 40;
- break;
- case 'p':
- shift = 50;
- break;
- case 'e':
- shift = 60;
- break;
- default:
- shift = 0;
- break;
- }
- v <<= shift;
-
- return v;
-}
-
/*
* Find the last instance of a particular command line argument
* (which should include the final =; do not use for boolean arguments)