37,14 → 37,6 |
#include <string.h> |
#include "main.h" |
|
int bpp2align[] = { |
[0] = 0, /** Invalid bpp. */ |
[1] = 1, /** 8bpp is not aligned. */ |
[2] = 2, /** 16bpp is naturally aligned. */ |
[3] = 4, /** 24bpp is aligned on 4 byte boundary. */ |
[4] = 4, /** 32bpp is naturally aligned. */ |
}; |
|
void write(const char *str, const int len) |
{ |
int i; |
61,27 → 53,6 |
return flag != -1; |
} |
|
int ofw_keyboard(keyboard_t *keyboard) |
{ |
char device_name[BUF_SIZE]; |
uint32_t virtaddr; |
|
if (ofw_get_property(ofw_aliases, "keyboard", device_name, sizeof(device_name)) <= 0) |
return false; |
|
phandle device = ofw_find_device(device_name); |
if (device == -1) |
return false; |
|
if (ofw_get_property(device, "address", &virtaddr, sizeof(virtaddr)) <= 0) |
return false; |
|
if (!(keyboard->addr = ofw_translate((void *) ((uintptr_t) virtaddr)))) |
return false; |
|
return true; |
} |
|
int ofw_cpu(cpu_t *cpu) |
{ |
char type_name[BUF_SIZE]; |