Rev 1764 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1764 | Rev 1771 | ||
---|---|---|---|
Line 31... | Line 31... | ||
31 | 31 | ||
32 | void write(const char *str, const int len) |
32 | void write(const char *str, const int len) |
33 | { |
33 | { |
34 | ofw_write(str, len); |
34 | ofw_write(str, len); |
35 | } |
35 | } |
- | 36 | ||
- | 37 | int ofw_keyboard(keyboard_t *keyboard) |
|
- | 38 | { |
|
- | 39 | char device_name[BUF_SIZE]; |
|
- | 40 | ||
- | 41 | if (ofw_get_property(ofw_aliases, "macio", device_name, sizeof(device_name)) <= 0) |
|
- | 42 | return false; |
|
- | 43 | ||
- | 44 | phandle device = ofw_find_device(device_name); |
|
- | 45 | if (device == -1) |
|
- | 46 | return false; |
|
- | 47 | ||
- | 48 | pci_reg_t macio; |
|
- | 49 | if (ofw_get_property(device, "assigned-addresses", &macio, sizeof(macio)) <= 0) |
|
- | 50 | return false; |
|
- | 51 | keyboard->addr = (void *) macio.addr.addr_lo; |
|
- | 52 | keyboard->size = macio.size_lo; |
|
- | 53 | ||
- | 54 | return true; |
|
- | 55 | } |