1 #include <linux/kernel.h>
2 #include <linux/init.h>
5 #include <asm/bios_ebda.h>
7 #define BIOS_LOWMEM_KILOBYTES 0x413
9 void __init
reserve_ebda_region(void)
11 unsigned int lowmem
, ebda_addr
;
13 /* To determine the position of the EBDA and the */
14 /* end of conventional memory, we need to look at */
15 /* the BIOS data area. In a paravirtual environment */
16 /* that area is absent. We'll just have to assume */
17 /* that the paravirt case can handle memory setup */
18 /* correctly, without our help. */
19 if (paravirt_enabled())
22 /* end of low (conventional) memory */
23 lowmem
= *(unsigned short *)__va(BIOS_LOWMEM_KILOBYTES
);
26 /* start of EBDA area */
27 ebda_addr
= get_bios_ebda();
29 /* Fixup: bios puts an EBDA in the top 64K segment */
30 /* of conventional memory, but does not adjust lowmem. */
31 if ((lowmem
- ebda_addr
) <= 0x10000)
34 /* Fixup: bios does not report an EBDA at all. */
35 /* Some old Dells seem to need 4k anyhow (bugzilla 2990) */
36 if ((ebda_addr
== 0) && (lowmem
>= 0x9f000))
39 /* Paranoia: should never happen, but... */
40 if ((lowmem
== 0) || (lowmem
>= 0x100000))
43 /* reserve all memory between lowmem and the 1MB mark */
44 reserve_early_overlap_ok(lowmem
, 0x100000, "BIOS reserved");