コード例 #1
0
static bool found_memconsole(void)
{
	unsigned int address;
	size_t length, cur;

	address = get_bios_ebda();
	if (!address) {
		printk(KERN_INFO "BIOS EBDA non-existent.\n");
		return false;
	}

	
	length = *(u8 *)phys_to_virt(address);
	length <<= 10; 

	for (cur = 0; cur < length; cur++) {
		struct biosmemcon_ebda *hdr = phys_to_virt(address + cur);

		
		if (hdr->signature == BIOS_MEMCONSOLE_V1_MAGIC) {
			found_v1_header(hdr);
			return true;
		}

		
		if (hdr->signature == BIOS_MEMCONSOLE_V2_MAGIC) {
			found_v2_header(hdr);
			return true;
		}
	}

	printk(KERN_INFO "BIOS console EBDA structure not found!\n");
	return false;
}
コード例 #2
0
/*
 * Search through the EBDA for the BIOS Memory Console, and
 * set the global variables to point to it.  Return true if found.
 */
static bool found_memconsole(void)
{
    unsigned int address;
    size_t length, cur;

    /* Is it communicated through CBMEM? */
    if (coreboot_system && check_cbmem())
        return true;

    address = get_bios_ebda();
    if (!address) {
        printk(KERN_INFO "BIOS EBDA non-existent.\n");
        return false;
    }

    /* EBDA length is byte 0 of EBDA (in KB) */
    length = *(u8 *)phys_to_virt(address);
    length <<= 10; /* convert to bytes */

    /*
     * Search through EBDA for BIOS memory console structure
     * note: signature is not necessarily dword-aligned
     */
    for (cur = 0; cur < length; cur++) {
        struct biosmemcon_ebda *hdr = phys_to_virt(address + cur);

        /* memconsole v1 */
        if (hdr->signature == BIOS_MEMCONSOLE_V1_MAGIC) {
            found_v1_header(hdr);
            return true;
        }

        /* memconsole v2 */
        if (hdr->signature == BIOS_MEMCONSOLE_V2_MAGIC) {
            found_v2_header(hdr);
            return true;
        }
    }

    printk(KERN_INFO "BIOS console EBDA structure not found!\n");
    return false;
}
コード例 #3
0
/*
 * Search through the EBDA for the BIOS Memory Console, and
 * set the global variables to point to it.  Return true if found.
 */
static bool memconsole_ebda_init(void)
{
	unsigned int address;
	size_t length, cur;

	address = get_bios_ebda();
	if (!address) {
		pr_info("memconsole: BIOS EBDA non-existent.\n");
		return false;
	}

	/* EBDA length is byte 0 of EBDA (in KB) */
	length = *(u8 *)phys_to_virt(address);
	length <<= 10; /* convert to bytes */

	/*
	 * Search through EBDA for BIOS memory console structure
	 * note: signature is not necessarily dword-aligned
	 */
	for (cur = 0; cur < length; cur++) {
		struct biosmemcon_ebda *hdr = phys_to_virt(address + cur);

		/* memconsole v1 */
		if (hdr->signature == BIOS_MEMCONSOLE_V1_MAGIC) {
			found_v1_header(hdr);
			return true;
		}

		/* memconsole v2 */
		if (hdr->signature == BIOS_MEMCONSOLE_V2_MAGIC) {
			found_v2_header(hdr);
			return true;
		}
	}

	pr_info("memconsole: BIOS console EBDA structure not found!\n");
	return false;
}