/trunk/kernel/genarch/src/ofw/ebus.c |
---|
127,7 → 127,7 |
if (!controller) |
return false; |
if (strcmp(ofw_tree_node_name(controller), "pci") != 0) { |
if (str_cmp(ofw_tree_node_name(controller), "pci") != 0) { |
/* |
* This is not a PCI node. |
*/ |
/trunk/kernel/genarch/src/ofw/fhc.c |
---|
66,7 → 66,7 |
*pa = addr; |
return true; |
} |
if (strcmp(ofw_tree_node_name(node->parent), "central") != 0) |
if (str_cmp(ofw_tree_node_name(node->parent), "central") != 0) |
panic("Unexpected parent node: %s.", ofw_tree_node_name(node->parent)); |
ofw_central_reg_t central_reg; |
/trunk/kernel/genarch/src/ofw/ofw_tree.c |
---|
66,7 → 66,7 |
unsigned int i; |
for (i = 0; i < node->properties; i++) { |
if (strcmp(node->property[i].name, name) == 0) |
if (str_cmp(node->property[i].name, name) == 0) |
return &node->property[i]; |
} |
109,7 → 109,7 |
* Try to find the disambigued name. |
*/ |
for (cur = node->child; cur; cur = cur->peer) { |
if (strcmp(cur->da_name, name) == 0) |
if (str_cmp(cur->da_name, name) == 0) |
return cur; |
} |
121,7 → 121,7 |
* are not always fully-qualified. |
*/ |
for (cur = node->child; cur; cur = cur->peer) { |
if (strcmp(ofw_tree_node_name(cur), name) == 0) |
if (str_cmp(ofw_tree_node_name(cur), name) == 0) |
return cur; |
} |
146,7 → 146,7 |
prop = ofw_tree_getprop(cur, "device_type"); |
if (!prop || !prop->value) |
continue; |
if (strcmp(prop->value, name) == 0) |
if (str_cmp(prop->value, name) == 0) |
return cur; |
} |
203,7 → 203,7 |
prop = ofw_tree_getprop(cur, "device_type"); |
if (!prop || !prop->value) |
continue; |
if (strcmp(prop->value, name) == 0) |
if (str_cmp(prop->value, name) == 0) |
return cur; |
} |
229,7 → 229,7 |
prop = ofw_tree_getprop(cur, "name"); |
if (!prop || !prop->value) |
continue; |
if (strcmp(prop->value, name) == 0) |
if (str_cmp(prop->value, name) == 0) |
return cur; |
} |
252,14 → 252,15 |
if (path[0] != '/') |
return NULL; |
for (i = 1; i < str_size(path) && node; i = j + 1) { |
for (j = i; j < str_size(path) && path[j] != '/'; j++) |
; |
if (i == j) /* skip extra slashes */ |
for (i = 1; (i < str_size(path)) && (node); i = j + 1) { |
for (j = i; (j < str_size(path)) && (path[j] != '/'); j++); |
/* Skip extra slashes */ |
if (i == j) |
continue; |
memcpy(buf, &path[i], j - i); |
buf[j - i] = '\0'; |
buf[j - i] = 0; |
node = ofw_tree_find_child(node, buf); |
} |
/trunk/kernel/genarch/src/ofw/pci.c |
---|
58,7 → 58,7 |
prop = ofw_tree_getprop(node, "ranges"); |
if (!prop) { |
if (strcmp(ofw_tree_node_name(node->parent), "pci") == 0) |
if (str_cmp(ofw_tree_node_name(node->parent), "pci") == 0) |
return ofw_pci_apply_ranges(node->parent, reg, pa); |
return false; |
} |
/trunk/kernel/genarch/src/drivers/dsrln/dsrlnout.c |
---|
40,13 → 40,18 |
#include <arch/asm.h> |
#include <console/console.h> |
#include <sysinfo/sysinfo.h> |
#include <string.h> |
static ioport8_t *dsrlnout_base; |
static void dsrlnout_putchar(outdev_t *dev __attribute__((unused)), const char ch, bool silent) |
static void dsrlnout_putchar(outdev_t *dev __attribute__((unused)), const wchar_t ch, bool silent) |
{ |
if (!silent) |
pio_write_8(dsrlnout_base, ch); |
if (!silent) { |
if (ascii_check(ch)) |
pio_write_8(dsrlnout_base, ch); |
else |
pio_write_8(dsrlnout_base, invalch); |
} |
} |
static outdev_t dsrlnout_console; |
/trunk/kernel/genarch/src/multiboot/multiboot.c |
---|
41,18 → 41,15 |
/** Extract command name from the multiboot module command line. |
* |
* @param buf Destination buffer (will always null-terminate). |
* @param n Size of destination buffer. |
* @param buf Destination buffer (will always NULL-terminate). |
* @param sz Size of destination buffer (in bytes). |
* @param cmd_line Input string (the command line). |
* |
*/ |
static void extract_command(char *buf, size_t n, const char *cmd_line) |
static void extract_command(char *buf, size_t sz, const char *cmd_line) |
{ |
const char *start, *end, *cp; |
size_t max_len; |
/* Find the first space. */ |
end = strchr(cmd_line, ' '); |
const char *end = str_chr(cmd_line, ' '); |
if (end == NULL) |
end = cmd_line + str_size(cmd_line); |
60,20 → 57,19 |
* Find last occurence of '/' before 'end'. If found, place start at |
* next character. Otherwise, place start at beginning of buffer. |
*/ |
cp = end; |
start = buf; |
const char *cp = end; |
const char *start = buf; |
while (cp != start) { |
if (*cp == '/') { |
start = cp + 1; |
break; |
} |
--cp; |
cp--; |
} |
/* Copy the command and null-terminate the string. */ |
max_len = min(n - 1, (size_t) (end - start)); |
strncpy(buf, start, max_len + 1); |
buf[max_len] = '\0'; |
/* Copy the command. */ |
str_ncpy(buf, start, min(sz, (size_t) (end - start) + 1)); |
} |
/** Parse multiboot information structure. |
87,8 → 83,6 |
void multiboot_info_parse(uint32_t signature, const multiboot_info_t *mi) |
{ |
uint32_t flags; |
multiboot_mod_t *mods; |
uint32_t i; |
if (signature == MULTIBOOT_LOADER_MAGIC) |
flags = mi->flags; |
98,10 → 92,11 |
} |
/* Copy module information. */ |
uint32_t i; |
if ((flags & MBINFO_FLAGS_MODS) != 0) { |
init.cnt = min(mi->mods_count, CONFIG_INIT_TASKS); |
mods = (multiboot_mod_t *) MULTIBOOT_PTR(mi->mods_addr); |
multiboot_mod_t *mods |
= (multiboot_mod_t *) MULTIBOOT_PTR(mi->mods_addr); |
for (i = 0; i < init.cnt; i++) { |
init.tasks[i].addr = PA2KA(mods[i].start); |
113,7 → 108,7 |
CONFIG_TASK_NAME_BUFLEN, |
MULTIBOOT_PTR(mods[i].string)); |
} else |
init.tasks[i].name[0] = '\0'; |
init.tasks[i].name[0] = 0; |
} |
} else |
init.cnt = 0; |
120,13 → 115,9 |
/* Copy memory map. */ |
int32_t mmap_length; |
multiboot_mmap_t *mme; |
uint32_t size; |
if ((flags & MBINFO_FLAGS_MMAP) != 0) { |
mmap_length = mi->mmap_length; |
mme = MULTIBOOT_PTR(mi->mmap_addr); |
int32_t mmap_length = mi->mmap_length; |
multiboot_mmap_t *mme = MULTIBOOT_PTR(mi->mmap_addr); |
e820counter = 0; |
i = 0; |
134,7 → 125,7 |
e820table[i++] = mme->mm_info; |
/* Compute address of next structure. */ |
size = sizeof(mme->size) + mme->size; |
uint32_t size = sizeof(mme->size) + mme->size; |
mme = ((void *) mme) + size; |
mmap_length -= size; |
} |