* [Patch] memparse should return long long
@ 2001-01-15 8:22 Christoph Rohland
0 siblings, 0 replies; 3+ messages in thread
From: Christoph Rohland @ 2001-01-15 8:22 UTC (permalink / raw)
To: Linus Torvalds, Alan Cox; +Cc: Ingo Molnar, Linux Kernel Mailing List
Hi,
The following patch lets memparse return a long long. This is needed
to use mem= on highmem machines.
Greetings
Christoph
diff -uNr 2.4.0-ac/arch/i386/kernel/setup.c 2.4.0-ac-memparse/arch/i386/kernel/setup.c
--- 2.4.0-ac/arch/i386/kernel/setup.c Tue Jan 2 21:57:54 2001
+++ 2.4.0-ac-memparse/arch/i386/kernel/setup.c Sun Jan 14 22:21:52 2001
@@ -558,7 +558,7 @@
* blow away any automatically generated
* size
*/
- unsigned long start_at, mem_size;
+ unsigned long long start_at, mem_size;
if (usermem == 0) {
/* first time in: zap the whitelist
diff -uNr 2.4.0-ac/include/linux/kernel.h 2.4.0-ac-memparse/include/linux/kernel.h
--- 2.4.0-ac/include/linux/kernel.h Sun Dec 17 12:54:01 2000
+++ 2.4.0-ac-memparse/include/linux/kernel.h Sun Jan 14 22:21:52 2001
@@ -62,7 +62,7 @@
extern int vsprintf(char *buf, const char *, va_list);
extern int get_option(char **str, int *pint);
extern char *get_options(char *str, int nints, int *ints);
-extern unsigned long memparse(char *ptr, char **retptr);
+extern unsigned long long memparse(char *ptr, char **retptr);
extern void dev_probe_lock(void);
extern void dev_probe_unlock(void);
diff -uNr 2.4.0-ac/lib/cmdline.c 2.4.0-ac-memparse/lib/cmdline.c
--- 2.4.0-ac/lib/cmdline.c Mon Aug 28 11:42:45 2000
+++ 2.4.0-ac-memparse/lib/cmdline.c Mon Jan 15 09:06:14 2001
@@ -93,9 +93,9 @@
* megabyte, or one gigabyte, respectively.
*/
-unsigned long memparse (char *ptr, char **retptr)
+unsigned long long memparse (char *ptr, char **retptr)
{
- unsigned long ret = simple_strtoul (ptr, retptr, 0);
+ unsigned long long ret = simple_strtoul (ptr, retptr, 0);
switch (**retptr) {
case 'G':
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [Patch] memparse should return long long
@ 2001-01-15 16:50 Dunlap, Randy
2001-01-15 17:25 ` Christoph Rohland
0 siblings, 1 reply; 3+ messages in thread
From: Dunlap, Randy @ 2001-01-15 16:50 UTC (permalink / raw)
To: 'Christoph Rohland', Linus Torvalds, Alan Cox
Cc: Ingo Molnar, Linux Kernel Mailing List
Why not (?):
> diff -uNr 2.4.0-ac/lib/cmdline.c 2.4.0-ac-memparse/lib/cmdline.c
> --- 2.4.0-ac/lib/cmdline.c Mon Aug 28 11:42:45 2000
> +++ 2.4.0-ac-memparse/lib/cmdline.c Mon Jan 15 09:06:14 2001
> @@ -93,9 +93,9 @@
> * megabyte, or one gigabyte, respectively.
> */
>
> -unsigned long memparse (char *ptr, char **retptr)
> +unsigned long long memparse (char *ptr, char **retptr)
> {
> - unsigned long ret = simple_strtoul (ptr, retptr, 0);
> + unsigned long long ret = simple_strtoul (ptr, retptr, 0);
! + unsigned long long ret = simple_strtoull (ptr, retptr, 0);
~Randy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Patch] memparse should return long long
2001-01-15 16:50 Dunlap, Randy
@ 2001-01-15 17:25 ` Christoph Rohland
0 siblings, 0 replies; 3+ messages in thread
From: Christoph Rohland @ 2001-01-15 17:25 UTC (permalink / raw)
To: Dunlap, Randy
Cc: Linus Torvalds, Alan Cox, Ingo Molnar, Linux Kernel Mailing List
Hi Randy,
On Mon, 15 Jan 2001, Randy Dunlap wrote:
> Why not (?):
Because I did not need it (always used #G or #M) and did not know the
function. But it's apparently correct to use simple_strtoull.
>> diff -uNr 2.4.0-ac/lib/cmdline.c 2.4.0-ac-memparse/lib/cmdline.c
>> --- 2.4.0-ac/lib/cmdline.c Mon Aug 28 11:42:45 2000
>> +++ 2.4.0-ac-memparse/lib/cmdline.c Mon Jan 15 09:06:14 2001
>> @@ -93,9 +93,9 @@
>> * megabyte, or one gigabyte, respectively.
>> */
>>
>> -unsigned long memparse (char *ptr, char **retptr)
>> +unsigned long long memparse (char *ptr, char **retptr)
>> {
>> - unsigned long ret = simple_strtoul (ptr, retptr, 0);
>> + unsigned long long ret = simple_strtoul (ptr, retptr, 0);
> ! + unsigned long long ret = simple_strtoull (ptr, retptr, 0);
>
> ~Randy
Greetings
Christoph
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-01-15 17:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-15 8:22 [Patch] memparse should return long long Christoph Rohland
-- strict thread matches above, loose matches on Subject: below --
2001-01-15 16:50 Dunlap, Randy
2001-01-15 17:25 ` Christoph Rohland
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox