#define wait_on_ibf(p, d) __wait_on_ibf(__LINE__, (p), (d)) staticint __wait_on_ibf(unsignedint line, unsignedint port, int desired)
{ unsignedint timeo; int state = ibf_status(port);
for (timeo = ec_timeout; state != desired && timeo; timeo--) {
mdelay(1);
state = ibf_status(port);
}
if ((state == desired) && (ec_timeout > EC_BASE_TIMEOUT) &&
timeo < (ec_timeout - EC_BASE_TIMEOUT)) {
printk(KERN_WARNING "olpc-ec: %d: waited %u ms for IBF!\n",
line, ec_timeout - timeo);
}
return !(state == desired);
}
#define wait_on_obf(p, d) __wait_on_obf(__LINE__, (p), (d)) staticint __wait_on_obf(unsignedint line, unsignedint port, int desired)
{ unsignedint timeo; int state = obf_status(port);
for (timeo = ec_timeout; state != desired && timeo; timeo--) {
mdelay(1);
state = obf_status(port);
}
if ((state == desired) && (ec_timeout > EC_BASE_TIMEOUT) &&
timeo < (ec_timeout - EC_BASE_TIMEOUT)) {
printk(KERN_WARNING "olpc-ec: %d: waited %u ms for OBF!\n",
line, ec_timeout - timeo);
}
return !(state == desired);
}
/* *ThisallowsthekerneltorunEmbeddedControllercommands.TheECis *documentedat<http://wiki.laptop.org/go/Embedded_controller>, and the *availableECcommandsarehere: *<http://wiki.laptop.org/go/Ec_specification>. Unfortunately, while *OpenFirmware'ssourceisavailable,theEC'sisnot.
*/ staticint olpc_xo1_ec_cmd(u8 cmd, u8 *inbuf, size_t inlen, u8 *outbuf,
size_t outlen, void *arg)
{ int ret = -EIO; int i; int restarts = 0;
/* Clear OBF */ for (i = 0; i < 10 && (obf_status(0x6c) == 1); i++)
inb(0x68); if (i == 10) {
printk(KERN_ERR "olpc-ec: timeout while attempting to " "clear OBF flag!\n"); goto err;
}
if (wait_on_ibf(0x6c, 0)) {
printk(KERN_ERR "olpc-ec: timeout waiting for EC to " "quiesce!\n"); goto err;
}
if (!olpc_ofw_present() || !platform_detect()) return0;
/* register the XO-1 and 1.5-specific EC handler */ if (olpc_platform_info.boardrev < olpc_board_pre(0xd0)) /* XO-1 */
olpc_ec_driver_register(&ec_xo1_driver, NULL); else
olpc_ec_driver_register(&ec_xo1_5_driver, NULL);
platform_device_register_simple("olpc-ec", -1, NULL, 0);
/* assume B1 and above models always have a DCON */ if (olpc_board_at_least(olpc_board(0xb1)))
olpc_platform_info.flags |= OLPC_F_DCON;
#ifdef CONFIG_PCI_OLPC /* If the VSA exists let it emulate PCI, if not emulate in kernel.
* XO-1 only. */ if (olpc_platform_info.boardrev < olpc_board_pre(0xd0) &&
!cs5535_has_vsa2())
x86_init.pci.arch_init = pci_olpc_init; #endif
if (olpc_platform_info.boardrev < olpc_board_pre(0xd0)) { /* XO-1 */
r = add_xo1_platform_devices(); if (r) return r;
}
return0;
}
postcore_initcall(olpc_init);
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-09-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.