• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/sys/dev/bhnd/bhndb/

Lines Matching refs:dwa

373 		struct bhndb_dw_alloc *dwa;
401 dwa = &r->dw_alloc[rnid];
402 dwa->win = win;
403 dwa->parent_res = NULL;
404 dwa->rnid = rnid;
405 dwa->target = 0x0;
407 LIST_INIT(&dwa->refs);
423 struct bhndb_dw_alloc *dwa;
426 dwa = &r->dw_alloc[i];
427 win = dwa->win;
430 dwa->parent_res = bhndb_host_resource_for_regwin(r->res, win);
431 if (dwa->parent_res == NULL) {
443 if (rman_get_size(dwa->parent_res) < win->win_offset +
448 rman_get_rid(dwa->parent_res),
571 struct bhndb_dw_alloc *dwa;
582 dwa = &br->dw_alloc[i];
585 if (bhndb_dw_is_free(br, dwa))
589 "leaked dynamic register window %d\n", dwa->rnid);
611 dwa = &br->dw_alloc[i];
613 LIST_FOREACH_SAFE(dwr, &dwa->refs, dw_link, dwr_next) {
1162 * Find the entry matching @p r in @p dwa's references, if any.
1164 * @param dwa The dynamic window allocation to search
1165 * @param r The resource to search for in @p dwa.
1168 bhndb_dw_find_resource_entry(struct bhndb_dw_alloc *dwa, struct resource *r)
1172 LIST_FOREACH(rentry, &dwa->refs, dw_link) {
1203 struct bhndb_dw_alloc *dwa;
1206 dwa = &br->dw_alloc[i];
1209 if (bhndb_dw_is_free(br, dwa))
1213 if (bhndb_dw_find_resource_entry(dwa, r) != NULL)
1214 return (dwa);
1260 * Retain a reference to @p dwa for use by @p res.
1262 * @param br The resource state owning @p dwa.
1263 * @param dwa The allocation record to be retained.
1264 * @param res The resource that will own a reference to @p dwa.
1270 bhndb_dw_retain(struct bhndb_resources *br, struct bhndb_dw_alloc *dwa,
1275 KASSERT(bhndb_dw_find_resource_entry(dwa, res) == NULL,
1285 LIST_INSERT_HEAD(&dwa->refs, rentry, dw_link);
1288 bit_set(br->dwa_freelist, dwa->rnid);
1294 * Release a reference to @p dwa previously retained by @p res. If the
1295 * reference count of @p dwa reaches zero, it will be added to the
1298 * @param br The resource state owning @p dwa.
1299 * @param dwa The allocation record to be released.
1300 * @param res The resource that currently owns a reference to @p dwa.
1303 bhndb_dw_release(struct bhndb_resources *br, struct bhndb_dw_alloc *dwa,
1309 rentry = bhndb_dw_find_resource_entry(dwa, r);
1316 if (LIST_EMPTY(&dwa->refs))
1317 bit_clear(br->dwa_freelist, dwa->rnid);
1321 * Attempt to set (or reset) the target address of @p dwa to map @p size bytes
1329 * @param br The resource state owning @p dwa.
1330 * @param dwa The allocation record to be configured.
1331 * @param addr The address to be mapped via @p dwa.
1339 struct bhndb_dw_alloc *dwa, bus_addr_t addr, bus_size_t size)
1345 rw = dwa->win;
1347 KASSERT(bhndb_dw_is_free(br, dwa) || mtx_owned(&br->dw_steal_mtx),
1352 dwa->target = addr - offset;
1359 error = BHNDB_SET_WINDOW_ADDR(dev, dwa->win, dwa->target);
1361 dwa->target = 0x0;
1415 * @param br The resource state owning @p dwa.
1416 * @param dwa The allocation record to be returned.
1421 struct bhndb_dw_alloc *dwa, bus_addr_t saved)
1427 error = bhndb_dw_set_addr(dev, br, dwa, saved, 0);