Lines Matching defs:md
179 static int valid_pages(md_t *md, mde_cookie_t cpu0);
236 * Routine to read a uint64_t from a given md
239 get_int(md_t md, mde_cookie_t node, char *propname, uint64_t *val)
241 int err = md_get_prop_val(md, node, propname, val);
306 cpuid_to_cpunode(md_t *md, int cpuid)
312 if (md == NULL)
315 rootnode = md_root_node(md);
319 n_cpunodes = md_alloc_scan_dag(md, rootnode, PROP_LG_CPU,
325 if (md_get_prop_val(md, cpunodes[i], PROP_LG_CPU_ID,
330 md_free_scan_dag(md, &cpunodes);
336 md_free_scan_dag(md, &cpunodes);
341 mpo_cpu_to_lgroup(md_t *md, mde_cookie_t cpunode)
349 n_lgroups = md_alloc_scan_dag(md, cpunode, PROP_LG_MEM_LG,
356 result = get_int(md, nodes[j], PROP_LG_LATENCY,
358 result |= get_int(md, nodes[j], PROP_LG_MATCH,
379 md_free_scan_dag(md, &nodes);
385 mpo_cpu_add(md_t *md, int cpuid)
394 if (md == NULL)
397 cpunode = cpuid_to_cpunode(md, cpuid);
401 i = mpo_cpu_to_lgroup(md, cpunode);
431 md_get_root(md_t *md)
436 n_nodes = md_node_count(md);
443 root = md_root_node(md);
451 MPO_DEBUG("md_get_root: md: %p\n", md);
458 lgrp_update(md_t *md, mde_cookie_t root)
465 n_lgrpnodes = md_alloc_scan_dag(md, root, PROP_LG_MEM_LG,
480 result = get_int(md, lgrpnodes[i], PROP_LG_MASK,
482 result |= get_int(md, lgrpnodes[i], PROP_LG_MATCH,
495 result = get_int(md, lgrpnodes[i], PROP_LG_LATENCY,
532 j = md_alloc_scan_dag(md, mpo_lgroup[i].node,
534 md_free_scan_dag(md, &nodes);
545 md_free_scan_dag(md, &lgrpnodes);
563 lgrp_traverse(md_t *md)
574 if ((root = md_get_root(md)) == MDE_INVAL_ELEM_COOKIE) {
579 n_mblocks = md_alloc_scan_dag(md, root, PROP_LG_MBLOCK, "fwd",
598 mblock_update(&new_config, md, mblocknodes);
615 n_cpunodes = md_alloc_scan_dag(md, root, PROP_LG_CPU, "fwd", &cpunodes);
626 if ((ret_val = lgrp_update(md, root)) == -1)
715 result = get_int(md, cpunodes[i], PROP_LG_CPU_ID, &k);
722 o = mpo_cpu_to_lgroup(md, cpunodes[i]);
732 if (valid_pages(md, cpunodes[0]) == 0) {
739 md_free_scan_dag(md, &cpunodes);
741 md_free_scan_dag(md, &mblocknodes);
790 md_t *md;
795 md = md_get_handle();
799 if (md == NULL) {
802 rc = lgrp_traverse(md);
803 (void) md_fini_handle(md);
1322 valid_pages(md_t *md, mde_cookie_t cpu0)
1339 if (md_get_prop_val(md, cpu0, "mmu-page-size-list", &szc_mask))
1561 mblock_update(mpo_config_t *mc, md_t md, mde_cookie_t *mblocknodes)
1570 result = get_int(md, mblocknodes[j], PROP_LG_BASE,
1579 result = get_int(md, mblocknodes[j], PROP_LG_SIZE,
1588 result = get_int(md, mblocknodes[j],
1647 md_t *md;
1651 if ((md = md_get_handle()) == NULL) {
1656 if ((root = md_get_root(md)) == MDE_INVAL_ELEM_COOKIE)
1659 nmblocks = md_alloc_scan_dag(md, root, PROP_LG_MBLOCK, "fwd",
1669 mblock_update(mc, md, mblocknodes);
1670 md_free_scan_dag(md, &mblocknodes);
1671 (void) md_fini_handle(md);