~ubuntu-branches/ubuntu/wily/grub2/wily

« back to all changes in this revision

Viewing changes to grub-core/kern/i386/pc/mmap.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2011-01-11 17:11:44 UTC
  • mfrom: (1.15.12 upstream)
  • mto: This revision was merged to the branch mainline in revision 60.
  • Revision ID: james.westby@ubuntu.com-20110111171144-c4c3hc0jslqa1bxe
Tags: 1.99~20110111-1
* New Bazaar snapshot.
  - Don't check amount of low memory, as reportedly INT 12h can be broken
    and if low memory is too low we wouldn't have gotten into
    grub_machine_init anyway (closes: #588293, LP: #513528).
  - Submenu default support (LP: #691878).
  - Fix optimisation-dependent grub-mklayout crash (closes: #609584).
* branch_butter.patch: Don't free an uninitialised pointer if /proc is
  unmounted (LP: #697493).
* Add a po/LINGUAS file listing the translations we've synced from the TP
  (closes: #609671).

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 
38
38
 
39
39
/*
 
40
 *
 
41
 * grub_get_conv_memsize(i) :  return the conventional memory size in KB.
 
42
 *      BIOS call "INT 12H" to get conventional memory size
 
43
 *      The return value in AX.
 
44
 */
 
45
static inline grub_uint16_t
 
46
grub_get_conv_memsize (void)
 
47
{
 
48
  struct grub_bios_int_registers regs;
 
49
 
 
50
  regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT;
 
51
  grub_bios_interrupt (0x12, &regs);
 
52
  return regs.eax & 0xffff;
 
53
}
 
54
 
 
55
/*
40
56
 * grub_get_ext_memsize() :  return the extended memory size in KB.
41
57
 *      BIOS call "INT 15H, AH=88H" to get extended memory size
42
58
 *      The return value in AX.
155
171
    {
156
172
      grub_uint32_t eisa_mmap = grub_get_eisa_mmap ();
157
173
 
 
174
      if (hook (0x0, ((grub_uint32_t) grub_get_conv_memsize ()) << 10,
 
175
                GRUB_MEMORY_AVAILABLE))
 
176
        return 0;
 
177
 
158
178
      if (eisa_mmap)
159
179
        {
160
180
          if (hook (0x100000, (eisa_mmap & 0xFFFF) << 10,
162
182
            hook (0x1000000, eisa_mmap & ~0xFFFF, GRUB_MEMORY_AVAILABLE);
163
183
        }
164
184
      else
165
 
        hook (0x100000, grub_get_ext_memsize () << 10, GRUB_MEMORY_AVAILABLE);
 
185
        hook (0x100000, ((grub_uint32_t) grub_get_ext_memsize ()) << 10,
 
186
              GRUB_MEMORY_AVAILABLE);
166
187
    }
167
188
 
168
189
  return 0;