Subversion Repositories HelenOS

Rev

Rev 3425 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3425 Rev 4377
Line 46... Line 46...
46
            ofw_write("\r", 1);
46
            ofw_write("\r", 1);
47
        ofw_write(&str[i], 1);
47
        ofw_write(&str[i], 1);
48
    }
48
    }
49
}
49
}
50
 
50
 
51
int ofw_keyboard(keyboard_t *keyboard)
51
int ofw_macio(macio_t *macio)
52
{
52
{
53
    char device_name[BUF_SIZE];
53
    char device_name[BUF_SIZE];
54
   
54
   
55
    if (ofw_get_property(ofw_aliases, "macio", device_name, sizeof(device_name)) <= 0)
55
    if ((ofw_get_property(ofw_aliases, "macio", device_name, sizeof(device_name)) <= 0)
-
 
56
        && (ofw_get_property(ofw_aliases, "mac-io", device_name, sizeof(device_name)) <= 0))
56
        return false;
57
        return false;
57
               
58
   
58
    phandle device = ofw_find_device(device_name);
59
    phandle device = ofw_find_device(device_name);
59
    if (device == -1)
60
    if (device == -1)
60
        return false;
61
        return false;
61
                               
62
   
62
    pci_reg_t macio;
63
    pci_reg_t pci_reg;
63
    if (ofw_get_property(device, "assigned-addresses", &macio, sizeof(macio)) <= 0)
64
    if (ofw_get_property(device, "assigned-addresses", &pci_reg, sizeof(pci_reg)) <= 0)
64
        return false;
65
        return false;
-
 
66
   
65
    keyboard->addr = (void *) macio.addr.addr_lo;
67
    macio->addr = (void *) pci_reg.addr.addr_lo;
66
    keyboard->size = macio.size_lo;
68
    macio->size = pci_reg.size_lo;
67
 
69
 
68
    return true;
70
    return true;
69
}
71
}
70
 
72
 
71
int ofw_translate_failed(ofw_arg_t flag)
73
int ofw_translate_failed(ofw_arg_t flag)