Lines Matching +full:3 +full:p0
2 * SPDX-License-Identifier: BSD-3-Clause
15 * 3. The names of the authors may not be used to endorse or promote
105 struct resource *res[3];
109 struct page0 *p0; member
141 sc->sample += sc->p0->chunksize / 2; in adlink_intr()
147 sc->p0->state = EIO; in adlink_intr()
149 if (sc->p0->state != STATE_RUN) { in adlink_intr()
150 printf("adlink: stopping %d\n", sc->p0->state); in adlink_intr()
158 bus_write_4(sc->res[0], 0x28, sc->p0->chunksize); in adlink_intr()
176 *paddr = vtophys(sc->p0); in adlink_mmap()
182 if (offset - o >= sc->p0->chunksize) { in adlink_mmap()
183 o += sc->p0->chunksize; in adlink_mmap()
206 if (sc->p0->state == STATE_RUN) in adlink_ioctl()
210 sc->p0->divisor = u; in adlink_ioctl()
213 if (sc->p0->state != STATE_RESET) in adlink_ioctl()
217 if (sc->p0->ringsize != 0 && sc->p0->ringsize % u) in adlink_ioctl()
219 sc->p0->chunksize = u; in adlink_ioctl()
222 if (sc->p0->state != STATE_RESET) in adlink_ioctl()
226 if (sc->p0->chunksize != 0 && u % sc->p0->chunksize) in adlink_ioctl()
228 sc->p0->ringsize = u; in adlink_ioctl()
231 if (sc->p0->state == STATE_RUN) in adlink_ioctl()
233 if (sc->p0->state == STATE_RESET) { in adlink_ioctl()
235 if (sc->p0->chunksize == 0) in adlink_ioctl()
236 sc->p0->chunksize = 4 * PAGE_SIZE; in adlink_ioctl()
237 if (sc->p0->ringsize == 0) in adlink_ioctl()
238 sc->p0->ringsize = 16 * sc->p0->chunksize; in adlink_ioctl()
239 if (sc->p0->divisor == 0) in adlink_ioctl()
240 sc->p0->divisor = 4; in adlink_ioctl()
242 sc->nchunks = sc->p0->ringsize / sc->p0->chunksize; in adlink_ioctl()
244 sizeof *sc->p0 > PAGE_SIZE) in adlink_ioctl()
246 sc->p0->o_ring = PAGE_SIZE; in adlink_ioctl()
247 sample = (uint64_t *)(sc->p0 + 1); in adlink_ioctl()
248 sc->p0->o_sample = in adlink_ioctl()
249 (uintptr_t)sample - (uintptr_t)(sc->p0); in adlink_ioctl()
257 pg->virt = contigmalloc(sc->p0->chunksize, in adlink_ioctl()
285 bus_write_4(sc->res[1], 0x04, sc->p0->divisor); in adlink_ioctl()
297 bus_write_4(sc->res[1], 0x18, 3); in adlink_ioctl()
303 sc->p0->state = STATE_RUN; in adlink_ioctl()
309 bus_write_4(sc->res[0], 0x28, sc->p0->chunksize); in adlink_ioctl()
318 if (sc->p0->state == STATE_RESET) in adlink_ioctl()
320 sc->p0->state = EINTR; in adlink_ioctl()
330 if (sc->p0->state == STATE_RESET) in adlink_ioctl()
332 sc->p0->state = EINTR; in adlink_ioctl()
408 sc->p0 = malloc(PAGE_SIZE, M_DEVBUF, M_WAITOK | M_ZERO); in adlink_attach()
409 sc->p0->version = PAGE0VERSION; in adlink_attach()
410 sc->p0->state = STATE_RESET; in adlink_attach()