lkml.org 
[lkml]   [2011]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v1 4/6] driver: Google Bootlog
    > +/*
    > + * Search for the BLOG pointer.
    > + */
    > +static struct bootlog_ptr * __init bootlog_find_pointer(void)
    > +{
    > + unsigned long address, length, cur;
    > + struct bootlog_ptr *bp;
    > +
    > + /* EBDA pointer contains segment the extended BIOS data area */
    > + address = *(uint16_t *)phys_to_virt(BLOG_EBDA_POINTER);
    > + address <<= 4; /* convert segment to physical address */
    > +
    > + /* EBDA length is byte 0 of the EBDA (stored in kB) */
    > + length = *(uint8_t *)phys_to_virt(address);
    > + length <<= 10; /* convert to bytes */

    Ok this is wrong on two counts

    1. If the EBDA pointer is zero then no EBDA is present (older
    boxes sometimes did this up to about the Athlon era).

    2. EBDA isn't an X86 property it's a PC property. asm/bios_ebda
    provides one helper and perhaps it all belongs in there (along with 'is
    it a PC' sanity check)

    3. And its probably a good idea given the standard of BIOS code to
    also check the EBDA end if given is actually within the 640K limit ...



    Alan


    \
     
     \ /
      Last update: 2011-01-25 01:53    [W:0.022 / U:0.132 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site