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

Function rman_init

freebsd/kern/subr_rman.c:127–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127int
128rman_init(struct rman *rm)
129{
130 static int once = 0;
131
132 if (once == 0) {
133 once = 1;
134 TAILQ_INIT(&rman_head);
135 mtx_init(&rman_mtx, "rman head", NULL, MTX_DEF);
136 }
137
138 if (rm->rm_start == 0 && rm->rm_end == 0)
139 rm->rm_end = ~0;
140 if (rm->rm_type == RMAN_UNINIT)
141 panic("rman_init");
142 if (rm->rm_type == RMAN_GAUGE)
143 panic("implement RMAN_GAUGE");
144
145 TAILQ_INIT(&rm->rm_list);
146 rm->rm_mtx = malloc(sizeof *rm->rm_mtx, M_RMAN, M_NOWAIT | M_ZERO);
147 if (rm->rm_mtx == NULL)
148 return ENOMEM;
149 mtx_init(rm->rm_mtx, "rman", NULL, MTX_DEF);
150
151 mtx_lock(&rman_mtx);
152 TAILQ_INSERT_TAIL(&rman_head, rm, rm_link);
153 mtx_unlock(&rman_mtx);
154 return 0;
155}
156
157int
158rman_manage_region(struct rman *rm, rman_res_t start, rman_res_t end)

Callers 15

apb_attachFunction · 0.85
qca955x_pci_attachFunction · 0.85
ar71xx_pci_attachFunction · 0.85
ar724x_pci_attachFunction · 0.85
apb_attachFunction · 0.85
nexus_probeFunction · 0.85
cpu_attachFunction · 0.85
octopci_attachFunction · 0.85
obio_attachFunction · 0.85
ciu_attachFunction · 0.85
mtk_pci_attachFunction · 0.85
obio_attachFunction · 0.85

Calls 5

mtx_initFunction · 0.85
mallocFunction · 0.85
panicFunction · 0.70
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected