MCPcopy Create free account
hub / github.com/F-Stack/f-stack / OF_decode_addr

Function OF_decode_addr

freebsd/mips/mips/ofw_machdep.c:39–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37#include <dev/ofw/ofw_subr.h>
38
39int
40OF_decode_addr(phandle_t dev, int regno, bus_space_tag_t *tag,
41 bus_space_handle_t *handle, bus_size_t *sz)
42{
43 bus_addr_t addr;
44 bus_size_t size;
45 pcell_t pci_hi;
46 int flags, res;
47
48 res = ofw_reg_to_paddr(dev, regno, &addr, &size, &pci_hi);
49 if (res < 0)
50 return (res);
51
52 /*
53 * Nothing special to do for PCI busses right now.
54 * This may need to be handled per-platform when it does come up.
55 */
56#ifdef notyet
57 if (pci_hi == OFW_PADDR_NOT_PCI) {
58 *tag = fdtbus_bs_tag;
59 flags = 0;
60 } else {
61 *tag = fdtbus_bs_tag;
62 flags = (pci_hi & OFW_PCI_PHYS_HI_PREFETCHABLE) ?
63 BUS_SPACE_MAP_PREFETCHABLE: 0;
64 }
65#else
66 *tag = fdtbus_bs_tag;
67 flags = 0;
68#endif
69
70 if (sz != NULL)
71 *sz = size;
72
73 return (bus_space_map(*tag, addr, size, flags, handle));
74}

Callers

nothing calls this directly

Calls 1

bus_space_mapFunction · 0.85

Tested by

no test coverage detected