-/* $OpenBSD: pmap7.c,v 1.30 2016/07/31 22:04:44 kettenis Exp $ */
+/* $OpenBSD: pmap7.c,v 1.31 2016/07/31 22:27:07 kettenis Exp $ */
/* $NetBSD: pmap.c,v 1.147 2004/01/18 13:03:50 scw Exp $ */
/*
return (size);
}
-/********************** Static device map routines ***************************/
-
-const struct pmap_devmap *pmap_devmap_table;
-
-/*
- * Register the devmap table. This is provided in case early console
- * initialization needs to register mappings created by bootstrap code
- * before pmap_devmap_bootstrap() is called.
- */
-void
-pmap_devmap_register(const struct pmap_devmap *table)
-{
-
- pmap_devmap_table = table;
-}
-
-/*
- * Map all of the static regions in the devmap table, and remember
- * the devmap table so other parts of the kernel can look up entries
- * later.
- */
-void
-pmap_devmap_bootstrap(vaddr_t l1pt, const struct pmap_devmap *table)
-{
- int i;
-
- pmap_devmap_table = table;
-
- for (i = 0; pmap_devmap_table[i].pd_size != 0; i++) {
-#ifdef VERBOSE_INIT_ARM
- printf("devmap: %08lx -> %08lx @ %08lx\n",
- pmap_devmap_table[i].pd_pa,
- pmap_devmap_table[i].pd_pa +
- pmap_devmap_table[i].pd_size - 1,
- pmap_devmap_table[i].pd_va);
-#endif
- pmap_map_chunk(l1pt, pmap_devmap_table[i].pd_va,
- pmap_devmap_table[i].pd_pa,
- pmap_devmap_table[i].pd_size,
- pmap_devmap_table[i].pd_prot,
- pmap_devmap_table[i].pd_cache);
- }
-}
-
-const struct pmap_devmap *
-pmap_devmap_find_pa(paddr_t pa, psize_t size)
-{
- int i;
-
- if (pmap_devmap_table == NULL)
- return (NULL);
-
- for (i = 0; pmap_devmap_table[i].pd_size != 0; i++) {
- if (pa >= pmap_devmap_table[i].pd_pa &&
- pa + size <= pmap_devmap_table[i].pd_pa +
- pmap_devmap_table[i].pd_size)
- return (&pmap_devmap_table[i]);
- }
-
- return (NULL);
-}
-
-const struct pmap_devmap *
-pmap_devmap_find_va(vaddr_t va, vsize_t size)
-{
- int i;
-
- if (pmap_devmap_table == NULL)
- return (NULL);
-
- for (i = 0; pmap_devmap_table[i].pd_size != 0; i++) {
- if (va >= pmap_devmap_table[i].pd_va &&
- va + size <= pmap_devmap_table[i].pd_va +
- pmap_devmap_table[i].pd_size)
- return (&pmap_devmap_table[i]);
- }
-
- return (NULL);
-}
-
/********************** PTE initialization routines **************************/
/*