Re: [PATCH] E820 memory detection

From: James Manning (jmm@raleigh.ibm.com)
Date: Wed Feb 02 2000 - 12:41:51 EST


[ Wednesday, February 2, 2000 ] david parsons wrote:
> --- ./include/asm-i386/e820.h.orig Thu Nov 18 19:25:28 1999
> +++ ./include/asm-i386/e820.h Wed Feb 2 11:19:20 2000
[snip]
> +#if CONFIG_ACPI
> +# define FLAG_E820_RECLAIM 0
> +#else
> +# define FLAG_E820_RECLAIM CONFIG_E820_RECLAIM
> +#endif
[snip]

Regardless of CONFIG_ACPI, FLAG_E820_RECLAIM gets defined

> +#ifdef FLAG_E820_RECLAIM
> + if ( (physical_memory.p_flags & CHK_PMEM_RECLAIM) && (type == E820_ACPI) )
> + flag |= RF_RECLAIM;
> + else if (type != E820_RAM)
> + return RF_NOT_RAM;
> +#else
> + if (type != E820_RAM)
> + return RF_NOT_RAM;
> +#endif
[snip]

I can't see the ifndef path getting taken... am I missing something?

> + if ( (E820_MAP_NR > 1) && (E820_MAP_NR < E820MAX) ) {
> + /* got a memory map; copy it into a safe place.
> + */
> + physical_memory.p_flags = (FLAG_E820_LENGTH ? CHK_PMEM_LENGTH : 0)
> + | (FLAG_E820_GULLIBLE ? CHK_PMEM_GULLIBLE : 0)
> + | (FLAG_E820_RECLAIM ? CHK_PMEM_RECLAIM : 0) ;
> + physical_memory.nr_bios = E820_MAP_NR;

Seems like the "#ifdef" succeeds regardless of CONFIG_ACPI
perhaps change the CONFIG_ACPI = true case to #undef FLAG_E820_RECLAIM?
AFAICT you'd only have to make the additional change of wrapping that
third line of p_flags in an ifdef... prob a more elegant method?

The other issue would seem to be that ifndef CONFIG_ACPI you get
"define FLAG_E820_RECLAIM CONFIG_E820_RECLAIM" which means it will
be either "y" or "n" (right?) and those would *both* seem to pass
the check against zero in (FLAG_E820_RECLAIM ? CHK_PMEM_RECLAIM : 0)

I just rolled out of bed, so if I'm being blatantly stupid just smack
me upside the head and move on :)

James

-- 
Miscellaneous Engineer --- IBM Netfinity Performance Development

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Feb 07 2000 - 21:00:08 EST