/*! * Board specific fixup function. It is called by \b setup_arch() in * setup.c file very early on during kernel starts. It allows the user to * statically fill in the proper values for the passed-in parameters. None of * the parameters is used currently. * * @param desc pointer to \b struct \b machine_desc * @param tags pointer to \b struct \b tag * @param cmdline pointer to the command line * @param mi pointer to \b struct \b meminfo */ static void __init fixup_mxc_board(struct machine_desc *desc, struct tag *tags, char **cmdline, struct meminfo *mi) { #ifdef CONFIG_KGDB_8250 int i; for (i = 0; i < (sizeof(serial_platform_data) / sizeof(serial_platform_data[0])); i += 1) kgdb8250_add_platform_port(i, &serial_platform_data[i]); #endif mxc_cpu_init(); /* Store command line for use on mxc_board_init */ strcpy(command_line, *cmdline); #ifdef CONFIG_DISCONTIGMEM do { int nid; mi->nr_banks = MXC_NUMNODES; for (nid = 0; nid < mi->nr_banks; nid++) { SET_NODE(mi, nid); } } while (0); #endif }
/*! * Board specific fixup function. It is called by \b setup_arch() in * setup.c file very early on during kernel starts. It allows the user to * statically fill in the proper values for the passed-in parameters. None of * the parameters is used currently. * * @param desc pointer to \b struct \b machine_desc * @param tags pointer to \b struct \b tag * @param cmdline pointer to the command line * @param mi pointer to \b struct \b meminfo */ static void __init fixup_mxc_board(struct machine_desc *desc, struct tag *tags, char **cmdline, struct meminfo *mi) { struct tag *t; #ifdef CONFIG_KGDB_8250 int i; for (i = 0; i < (sizeof(serial_platform_data) / sizeof(serial_platform_data[0])); i += 1) kgdb8250_add_platform_port(i, &serial_platform_data[i]); #endif mxc_cpu_init(); for_each_tag(t, tags) { if (t->hdr.tag == ATAG_MEM) { t->u.mem.size = MEM_SIZE; break; } } if (t->hdr.size == 0) { printk("%s: no mem tag found\n", __FUNCTION__); } #ifdef CONFIG_DISCONTIGMEM do { int nid; mi->nr_banks = MXC_NUMNODES; for (nid = 0; nid < mi->nr_banks; nid++) { SET_NODE(mi, nid); } } while (0); #endif }
/*! * Board specific fixup function. It is called by \b setup_arch() in * setup.c file very early on during kernel starts. It allows the user to * statically fill in the proper values for the passed-in parameters. None of * the parameters is used currently. * * @param desc pointer to \b struct \b machine_desc * @param tags pointer to \b struct \b tag * @param cmdline pointer to the command line * @param mi pointer to \b struct \b meminfo */ static void __init fixup_mxc_board(struct machine_desc *desc, struct tag *tags, char **cmdline, struct meminfo *mi) { struct tag * t; mxc_cpu_init(); for_each_tag(t, tags) { if (t->hdr.tag == ATAG_MEM) { t->u.mem.size = MEM_SIZE; break; } } if (t->hdr.size == 0) { printk("%s: no mem tag found\n", __FUNCTION__); } /* Store command line for use on mxc_board_init */ strcpy(command_line, *cmdline); #ifdef CONFIG_DISCONTIGMEM do { int nid; mi->nr_banks = MXC_NUMNODES; for (nid=0; nid < mi->nr_banks; nid++) SET_NODE(mi, nid); } while (0); #endif }
static void __init fixup_innovator(struct machine_desc *desc, struct tag *tags, char **cmdline, struct meminfo *mi) { int nid; mi->nr_banks = OMAP_NUMNODES; for (nid=0; nid < mi->nr_banks; nid++) SET_NODE(mi, nid); }
static void __init fixup_mainstone(struct machine_desc *desc, struct tag *tags, char **cmdline, struct meminfo *mi) { int nid; mi->nr_banks = NR_NODES; for (nid=0; nid < mi->nr_banks; nid++) SET_NODE(mi, nid); }
/*! * Board specific fixup function. It is called by \b setup_arch() in * setup.c file very early on during kernel starts. It allows the user to * statically fill in the proper values for the passed-in parameters. None of * the parameters is used currently. * * @param desc pointer to \b struct \b machine_desc * @param tags pointer to \b struct \b tag * @param cmdline pointer to the command line * @param mi pointer to \b struct \b meminfo */ static void __init fixup_mxc_board(struct machine_desc *desc, struct tag *tags, char **cmdline, struct meminfo *mi) { mxc_cpu_init(); #ifdef CONFIG_DISCONTIGMEM do { int nid; mi->nr_banks = MXC_NUMNODES; for (nid = 0; nid < mi->nr_banks; nid++) SET_NODE(mi, nid); } while (0); #endif }
LEAFTYPE radix_add(struct ROOTSTRUCT * tree, LEAFTYPE leaf, EXTRA_ARG aux, int should_replace, int* error) { LEAFTYPE result; struct _internal_node * node, * parent, * child; uint32_t dir, dir2; int32_t critbit; *error = 0; if (tree->leafcount == 0) { tree->root.leaf = leaf; tree->leafcount ++; return NO_LEAF; } else if (tree->leafcount == 1) { result = tree->root.leaf; critbit = COMPARE(leaf, result); if (critbit == -1) { if (should_replace) { node->child[dir].leaf = leaf; return result; } else return leaf; } else { node = (struct _internal_node *) ALLOC(sizeof (struct _internal_node)); if (node == NULL) { *error = -1; return NO_LEAF; } else { node->critbit = critbit; dir = DECIDE(leaf, critbit, aux); node->child[dir].leaf = leaf; SET_LEAF(node, dir); } result = tree->root.leaf; node->child[1 - dir].leaf = tree->root.leaf; SET_LEAF(node, 1 - dir); tree->root.node = node; tree->leafcount ++; return NO_LEAF; } } /* else */ node = tree->root.node; while (1) { dir = DECIDE(leaf, node->critbit, aux); if (IS_LEAF(node, dir)) { result = node->child[dir].leaf; break; } else { node = node->child[dir].node; } } critbit = COMPARE(leaf, result); if (critbit == -1) { if (should_replace) { node->child[dir].leaf = leaf; return result; } else return leaf; } else { node = (struct _internal_node *) ALLOC(sizeof (struct _internal_node)); if (node == NULL) { *error = -1; return NO_LEAF; } else { node->critbit = critbit; dir = DECIDE(leaf, critbit, aux); node->child[dir].leaf = leaf; SET_LEAF(node, dir); } child = tree->root.node; if (node->critbit < child->critbit) { node->child[1 - dir].node = child; SET_NODE(node, 1 - dir); tree->root.node = node; } else while (1) { parent = child; dir2 = DECIDE(leaf, parent->critbit, aux); if (IS_LEAF(parent, dir2)) { result = parent->child[dir2].leaf; //node->child[1 - dir].leaf = tree->root.leaf; node->child[1 - dir].leaf = parent->child[dir2].leaf; SET_LEAF(node, 1 - dir); parent->child[dir2].node = node; SET_NODE(parent, dir2); break; } else { child = parent->child[dir2].node; if (node->critbit < child->critbit) { node->child[1 - dir].node = child; SET_NODE(node, 1 - dir); parent->child[dir2].node = node; SET_NODE(parent, dir2); break; } } } tree->leafcount ++; return NO_LEAF; } }