/openbmc/linux/lib/ |
H A D | kfifo.c | 3 * A generic kernel FIFO implementation 17 * internal helper to calculate the unused elements in a fifo 19 static inline unsigned int kfifo_unused(struct __kfifo *fifo) in kfifo_unused() argument 21 return (fifo->mask + 1) - (fifo->in - fifo->out); in kfifo_unused() 24 int __kfifo_alloc(struct __kfifo *fifo, unsigned int size, in __kfifo_alloc() argument 33 fifo->in = 0; in __kfifo_alloc() 34 fifo->out = 0; in __kfifo_alloc() 35 fifo->esize = esize; in __kfifo_alloc() 38 fifo->data = NULL; in __kfifo_alloc() 39 fifo->mask = 0; in __kfifo_alloc() [all …]
|
/openbmc/qemu/util/ |
H A D | fifo8.c | 2 * Generic FIFO component, implemented as a circular buffer. 19 void fifo8_reset(Fifo8 *fifo) in fifo8_reset() argument 21 fifo->num = 0; in fifo8_reset() 22 fifo->head = 0; in fifo8_reset() 25 void fifo8_create(Fifo8 *fifo, uint32_t capacity) in fifo8_create() argument 27 fifo->data = g_new(uint8_t, capacity); in fifo8_create() 28 fifo->capacity = capacity; in fifo8_create() 29 fifo8_reset(fifo); in fifo8_create() 32 void fifo8_destroy(Fifo8 *fifo) in fifo8_destroy() argument 34 g_free(fifo->data); in fifo8_destroy() [all …]
|
/openbmc/qemu/include/qemu/ |
H A D | fifo32.h | 21 Fifo8 fifo; member 26 * @fifo: struct Fifo32 to initialise with new FIFO 27 * @capacity: capacity of the newly created FIFO expressed in 32 bit words 29 * Create a FIFO of the specified size. Clients should call fifo32_destroy() 30 * when finished using the fifo. The FIFO is initially empty. 33 static inline void fifo32_create(Fifo32 *fifo, uint32_t capacity) in fifo32_create() argument 35 fifo8_create(&fifo->fifo, capacity * sizeof(uint32_t)); in fifo32_create() 40 * @fifo: FIFO to cleanup 42 * Cleanup a FIFO created with fifo32_create(). Frees memory created for FIFO 43 * storage. The FIFO is no longer usable after this has been called. [all …]
|
H A D | fifo8.h | 15 * @fifo: struct Fifo8 to initialise with new FIFO 16 * @capacity: capacity of the newly created FIFO 18 * Create a FIFO of the specified capacity. Clients should call fifo8_destroy() 19 * when finished using the fifo. The FIFO is initially empty. 21 void fifo8_create(Fifo8 *fifo, uint32_t capacity); 25 * @fifo: FIFO to cleanup 27 * Cleanup a FIFO created with fifo8_create(). Frees memory created for FIFO 28 * storage. The FIFO is no longer usable after this has been called. 30 void fifo8_destroy(Fifo8 *fifo); 34 * @fifo: FIFO to push to [all …]
|
/openbmc/linux/include/linux/ |
H A D | kfifo.h | 3 * A generic kernel FIFO implementation 12 * How to porting drivers to the new generic FIFO API: 31 * and one writer is using the fifo and no kfifo_reset() will be called. 98 * helper macro to distinguish between real in place fifo where the fifo 99 * array is a part of the structure and the fifo type where the array is 100 * outside of the fifo structure. 102 #define __is_kfifo_ptr(fifo) \ argument 103 (sizeof(*fifo) == sizeof(STRUCT_KFIFO_PTR(typeof(*(fifo)->type)))) 106 * DECLARE_KFIFO_PTR - macro to declare a fifo pointer object 107 * @fifo: name of the declared fifo [all …]
|
/openbmc/qemu/tests/unit/ |
H A D | test-fifo.c | 23 Fifo8 fifo; in test_fifo8_pop_bufptr_wrap() local 29 fifo8_create(&fifo, 8); in test_fifo8_pop_bufptr_wrap() 32 * FIFO: [ . . . . . . . . ] in test_fifo8_pop_bufptr_wrap() 35 fifo8_push_all(&fifo, data_in1, sizeof(data_in1)); in test_fifo8_pop_bufptr_wrap() 38 * FIFO: [ 1 2 3 4 . . . . ] in test_fifo8_pop_bufptr_wrap() 40 buf = fifo8_pop_bufptr(&fifo, 2, &count); in test_fifo8_pop_bufptr_wrap() 43 * FIFO: [ 1 2 3 4 . . . . ] in test_fifo8_pop_bufptr_wrap() 49 fifo8_push_all(&fifo, data_in2, sizeof(data_in2)); in test_fifo8_pop_bufptr_wrap() 52 * FIFO: [ 9 a 3 4 5 6 7 8 ] in test_fifo8_pop_bufptr_wrap() 54 buf = fifo8_pop_bufptr(&fifo, 8, &count); in test_fifo8_pop_bufptr_wrap() [all …]
|
/openbmc/linux/drivers/gpu/drm/nouveau/nvkm/engine/fifo/ |
H A D | base.c | 44 nvkm_runl_foreach(runl, engine->subdev.device->fifo) { in nvkm_fifo_ctxsw_in_progress() 55 nvkm_fifo_pause(struct nvkm_fifo *fifo, unsigned long *flags) in nvkm_fifo_pause() argument 57 return fifo->func->pause(fifo, flags); in nvkm_fifo_pause() 61 nvkm_fifo_start(struct nvkm_fifo *fifo, unsigned long *flags) in nvkm_fifo_start() argument 63 return fifo->func->start(fifo, flags); in nvkm_fifo_start() 67 nvkm_fifo_fault(struct nvkm_fifo *fifo, struct nvkm_fault_data *info) in nvkm_fifo_fault() argument 69 return fifo->func->mmu_fault->recover(fifo, info); in nvkm_fifo_fault() 76 struct nvkm_fifo *fifo = nvkm_fifo(oclass->engine); in nvkm_fifo_class_new() local 78 if (oclass->engn == &fifo->func->cgrp.user) in nvkm_fifo_class_new() 79 return nvkm_ucgrp_new(fifo, oclass, argv, argc, pobject); in nvkm_fifo_class_new() [all …]
|
H A D | Kbuild | 2 nvkm-y += nvkm/engine/fifo/base.o 3 nvkm-y += nvkm/engine/fifo/cgrp.o 4 nvkm-y += nvkm/engine/fifo/chan.o 5 nvkm-y += nvkm/engine/fifo/chid.o 6 nvkm-y += nvkm/engine/fifo/runl.o 7 nvkm-y += nvkm/engine/fifo/runq.o 9 nvkm-y += nvkm/engine/fifo/nv04.o 10 nvkm-y += nvkm/engine/fifo/nv10.o 11 nvkm-y += nvkm/engine/fifo/nv17.o 12 nvkm-y += nvkm/engine/fifo/nv40.o [all …]
|
H A D | gf100.c | 43 nvkm_wr32(chan->cgrp->runl->fifo->engine.subdev.device, 0x002634, chan->id); in gf100_chan_preempt() 49 struct nvkm_device *device = chan->cgrp->runl->fifo->engine.subdev.device; in gf100_chan_stop() 57 struct nvkm_device *device = chan->cgrp->runl->fifo->engine.subdev.device; in gf100_chan_start() 67 struct nvkm_fifo *fifo = chan->cgrp->runl->fifo; in gf100_chan_unbind() local 68 struct nvkm_device *device = fifo->engine.subdev.device; in gf100_chan_unbind() 71 gf100_fifo_intr_engine(fifo); in gf100_chan_unbind() 79 struct nvkm_device *device = chan->cgrp->runl->fifo->engine.subdev.device; in gf100_chan_bind() 205 struct nvkm_fifo *fifo = runl->fifo; in gf100_engn_mmu_fault_triggered() local 206 struct nvkm_device *device = fifo->engine.subdev.device; in gf100_engn_mmu_fault_triggered() 213 spin_lock(&fifo->lock); in gf100_engn_mmu_fault_triggered() [all …]
|
H A D | nv04.c | 43 struct nvkm_fifo *fifo = chan->cgrp->runl->fifo; in nv04_chan_stop() local 44 struct nvkm_device *device = fifo->engine.subdev.device; in nv04_chan_stop() 51 /* prevent fifo context switches */ in nv04_chan_stop() 52 spin_lock_irqsave(&fifo->lock, flags); in nv04_chan_stop() 56 chid = nvkm_rd32(device, NV03_PFIFO_CACHE1_PUSH1) & fifo->chid->mask; in nv04_chan_stop() 80 nvkm_wr32(device, NV03_PFIFO_CACHE1_PUSH1, fifo->chid->mask); in nv04_chan_stop() 88 spin_unlock_irqrestore(&fifo->lock, flags); in nv04_chan_stop() 94 struct nvkm_fifo *fifo = chan->cgrp->runl->fifo; in nv04_chan_start() local 97 spin_lock_irqsave(&fifo->lock, flags); in nv04_chan_start() 98 nvkm_mask(fifo->engine.subdev.device, NV04_PFIFO_MODE, BIT(chan->id), BIT(chan->id)); in nv04_chan_start() [all …]
|
/openbmc/linux/sound/soc/meson/ |
H A D | axg-fifo.c | 17 #include "axg-fifo.h" 21 * capture frontend DAI. The logic behind this two types of fifo is very 68 static void __dma_enable(struct axg_fifo *fifo, bool enable) in __dma_enable() argument 70 regmap_update_bits(fifo->map, FIFO_CTRL0, CTRL0_DMA_EN, in __dma_enable() 77 struct axg_fifo *fifo = axg_fifo_data(ss); in axg_fifo_pcm_trigger() local 83 __dma_enable(fifo, true); in axg_fifo_pcm_trigger() 88 __dma_enable(fifo, false); in axg_fifo_pcm_trigger() 101 struct axg_fifo *fifo = axg_fifo_data(ss); in axg_fifo_pcm_pointer() local 105 regmap_read(fifo->map, FIFO_STATUS2, &addr); in axg_fifo_pcm_pointer() 116 struct axg_fifo *fifo = axg_fifo_data(ss); in axg_fifo_pcm_hw_params() local [all …]
|
H A D | aiu-fifo.c | 13 #include "aiu-fifo.h" 37 struct aiu_fifo *fifo = snd_soc_dai_dma_data_get_playback(dai); in aiu_fifo_pointer() local 41 addr = snd_soc_component_read(component, fifo->mem_offset + AIU_MEM_RD); in aiu_fifo_pointer() 49 struct aiu_fifo *fifo = snd_soc_dai_dma_data_get_playback(dai); in aiu_fifo_enable() local 54 fifo->mem_offset + AIU_MEM_CONTROL, in aiu_fifo_enable() 83 struct aiu_fifo *fifo = snd_soc_dai_dma_data_get_playback(dai); in aiu_fifo_prepare() local 86 fifo->mem_offset + AIU_MEM_CONTROL, in aiu_fifo_prepare() 90 fifo->mem_offset + AIU_MEM_CONTROL, in aiu_fifo_prepare() 101 struct aiu_fifo *fifo = snd_soc_dai_dma_data_get_playback(dai); in aiu_fifo_hw_params() local 104 /* Setup the fifo boundaries */ in aiu_fifo_hw_params() [all …]
|
/openbmc/linux/drivers/staging/axis-fifo/ |
H A D | axis-fifo.c | 3 * Xilinx AXIS FIFO: interface to the Xilinx AXI-Stream FIFO IP core 91 #define XLLF_INT_TFPF_MASK 0x00400000 /* Tx FIFO Programmable Full */ 92 #define XLLF_INT_TFPE_MASK 0x00200000 /* Tx FIFO Programmable Empty */ 93 #define XLLF_INT_RFPF_MASK 0x00100000 /* Rx FIFO Programmable Full */ 94 #define XLLF_INT_RFPE_MASK 0x00080000 /* Rx FIFO Programmable Empty */ 126 unsigned int rx_fifo_depth; /* max words in the receive fifo */ 127 unsigned int tx_fifo_depth; /* max words in the transmit fifo */ 128 int has_rx_fifo; /* whether the IP has the rx fifo enabled */ 129 int has_tx_fifo; /* whether the IP has the tx fifo enabled */ 150 struct axis_fifo *fifo = dev_get_drvdata(dev); in sysfs_write() local [all …]
|
/openbmc/linux/drivers/platform/mellanox/ |
H A D | mlxbf-tmfifo.c | 38 /* Virtual devices sharing the TM FIFO. */ 76 * @fifo: pointer to the tmfifo structure 95 struct mlxbf_tmfifo *fifo; member 134 * @tx_buf: tx buffer used to buffer data before writing into the FIFO 150 * @fifo: pointer to the tmfifo structure 155 struct mlxbf_tmfifo *fifo; member 180 * @rx_fifo_size: number of entries of the Rx FIFO 181 * @tx_fifo_size: number of entries of the Tx FIFO 211 * @len: payload length in network byte order. Messages sent into the FIFO 245 /* Free vrings of the FIFO device. */ [all …]
|
/openbmc/linux/drivers/usb/renesas_usbhs/ |
H A D | fifo.c | 98 struct usbhs_fifo *fifo); 99 static struct dma_chan *usbhsf_dma_chan_get(struct usbhs_fifo *fifo, 109 struct usbhs_fifo *fifo = usbhs_pipe_to_fifo(pipe); in usbhs_pkt_pop() local 123 if (fifo) in usbhs_pkt_pop() 124 chan = usbhsf_dma_chan_get(fifo, pkt); in usbhs_pkt_pop() 141 if (fifo) in usbhs_pkt_pop() 142 usbhsf_fifo_unselect(pipe, fifo); in usbhs_pkt_pop() 255 * FIFO ctrl 258 struct usbhs_fifo *fifo) in usbhsf_send_terminator() argument 262 usbhs_bset(priv, fifo->ctr, BVAL, BVAL); in usbhsf_send_terminator() [all …]
|
/openbmc/linux/drivers/iio/imu/inv_icm42600/ |
H A D | inv_icm42600_buffer.c | 20 /* FIFO header: 1 byte */ 52 /* FIFO empty */ in inv_icm42600_fifo_decode_packet() 105 if (st->fifo.en & INV_ICM42600_SENSOR_GYRO) in inv_icm42600_buffer_update_fifo_period() 110 if (st->fifo.en & INV_ICM42600_SENSOR_ACCEL) in inv_icm42600_buffer_update_fifo_period() 120 st->fifo.period = period; in inv_icm42600_buffer_update_fifo_period() 129 /* update only FIFO EN bits */ in inv_icm42600_buffer_set_fifo_en() 147 st->fifo.en = fifo_en; in inv_icm42600_buffer_set_fifo_en() 182 * inv_icm42600_buffer_update_watermark - update watermark FIFO threshold 187 * FIFO watermark threshold is computed based on the required watermark values 200 * to the FIFO frequency. Beware that this is only true because we are not [all …]
|
/openbmc/linux/drivers/md/bcache/ |
H A D | util.h | 120 #define fifo_for_each(c, fifo, iter) \ argument 121 for (iter = (fifo)->front; \ 122 c = (fifo)->data[iter], iter != (fifo)->back; \ 123 iter = (iter + 1) & (fifo)->mask) 125 #define __init_fifo(fifo, gfp) \ argument 128 BUG_ON(!(fifo)->size); \ 130 _allocated_size = roundup_pow_of_two((fifo)->size + 1); \ 131 _bytes = _allocated_size * sizeof(*(fifo)->data); \ 133 (fifo)->mask = _allocated_size - 1; \ 134 (fifo)->front = (fifo)->back = 0; \ [all …]
|
/openbmc/linux/drivers/usb/fotg210/ |
H A D | fotg210-udc.h | 47 /* Cx configuration and FIFO Empty Status register(0x120) */ 49 #define DCFESR_FIFO_EMPTY(fifo) (1 << 8 << (fifo)) argument 78 #define DMISGR1_MF_IN_INT(fifo) (1 << (16 + (fifo))) argument 87 #define DMISGR1_MF_OUTSPK_INT(fifo) (0x3 << (fifo) * 2) argument 111 #define DISGR1_OUT_INT(fifo) (1 << ((fifo) * 2)) argument 112 #define DISGR1_SPK_INT(fifo) (1 << 1 << ((fifo) * 2)) argument 113 #define DISGR1_IN_INT(fifo) (1 << 16 << (fifo)) argument 165 /* Device FIFO Map Register (0x1A8) */ 167 #define FIFOMAP_DIROUT(fifo) (0x0 << 4 << (fifo) * 8) argument 168 #define FIFOMAP_DIRIN(fifo) (0x1 << 4 << (fifo) * 8) argument [all …]
|
/openbmc/linux/sound/core/seq/ |
H A D | seq_fifo.h | 3 * ALSA sequencer FIFO 13 /* === FIFO === */ 16 struct snd_seq_pool *pool; /* FIFO pool */ 17 struct snd_seq_event_cell *head; /* pointer to head of fifo */ 18 struct snd_seq_event_cell *tail; /* pointer to tail of fifo */ 27 /* create new fifo (constructor) */ 30 /* delete fifo (destructor) */ 34 /* enqueue event to fifo */ 37 /* lock fifo from release */ 38 #define snd_seq_fifo_lock(fifo) snd_use_lock_use(&(fifo)->use_lock) argument [all …]
|
/openbmc/linux/drivers/net/ethernet/intel/fm10k/ |
H A D | fm10k_mbx.c | 7 * fm10k_fifo_init - Initialize a message FIFO 8 * @fifo: pointer to FIFO 9 * @buffer: pointer to memory to be used to store FIFO 10 * @size: maximum message size to store in FIFO, must be 2^n - 1 12 static void fm10k_fifo_init(struct fm10k_mbx_fifo *fifo, u32 *buffer, u16 size) in fm10k_fifo_init() argument 14 fifo->buffer = buffer; in fm10k_fifo_init() 15 fifo->size = size; in fm10k_fifo_init() 16 fifo->head = 0; in fm10k_fifo_init() 17 fifo->tail = 0; in fm10k_fifo_init() 21 * fm10k_fifo_used - Retrieve used space in FIFO [all …]
|
/openbmc/linux/arch/powerpc/platforms/powernv/ |
H A D | vas-fault.c | 21 * The maximum FIFO size for fault window can be 8MB 22 * (VAS_RX_FIFO_SIZE_MAX). Using 4MB FIFO since each VAS 24 * 8MB FIFO can be used if expects more faults for each VAS 32 unsigned long *fifo = entry; in dump_fifo() local 35 pr_err("Fault fifo size %d, Max crbs %d\n", vinst->fault_fifo_size, in dump_fifo() 38 /* Dump 10 CRB entries or until end of FIFO */ in dump_fifo() 39 pr_err("Fault FIFO Dump:\n"); in dump_fifo() 40 for (i = 0; i < 10*(CRB_SIZE/8) && fifo < end; i += 4, fifo += 4) { in dump_fifo() 42 i, fifo, *fifo, *(fifo+1), *(fifo+2), *(fifo+3)); in dump_fifo() 47 * Process valid CRBs in fault FIFO. [all …]
|
/openbmc/linux/Documentation/devicetree/bindings/powerpc/fsl/ |
H A D | mpc5121-psc.txt | 8 fsl,mpc5121-immr SoC node. Additionally the PSC FIFO 9 Controller node fsl,mpc5121-psc-fifo is required there: 19 PSC FIFO Controller and b is a field that represents an 23 - fsl,rx-fifo-size : the size of the RX fifo slice (a multiple of 4) 24 - fsl,tx-fifo-size : the size of the TX fifo slice (a multiple of 4) 30 for that is fsl,mpc5121-psc-spi. It requires a fsl,mpc5121-psc-fifo as well. 35 fsl,mpc512x-psc-fifo node 39 - compatible : Should be "fsl,<soc>-psc-fifo" 42 FIFO Controller 44 PSC FIFO Controller and b is a field that represents an [all …]
|
/openbmc/linux/drivers/isdn/hardware/mISDN/ |
H A D | hfcsusb.c | 697 conhdlc = 8; /* enable FIFO */ in hfcsusb_setup_bch() 803 hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len, in hfcsusb_rx_frame() argument 806 struct hfcsusb *hw = fifo->hw; in hfcsusb_rx_frame() 809 int fifon = fifo->fifonum; in hfcsusb_rx_frame() 815 printk(KERN_DEBUG "%s: %s: fifo(%i) len(%i) " in hfcsusb_rx_frame() 818 fifo->dch, fifo->bch, fifo->ech); in hfcsusb_rx_frame() 823 if ((!!fifo->dch + !!fifo->bch + !!fifo->ech) != 1) { in hfcsusb_rx_frame() 830 if (fifo->dch) { in hfcsusb_rx_frame() 831 rx_skb = fifo->dch->rx_skb; in hfcsusb_rx_frame() 832 maxlen = fifo->dch->maxlen; in hfcsusb_rx_frame() [all …]
|
/openbmc/linux/sound/arm/ |
H A D | pxa2xx-ac97-regs.h | 10 #define POCR_FEIE (1 << 3) /* FIFO Error Interrupt Enable */ 11 #define POCR_FSRIE (1 << 1) /* FIFO Service Request Interrupt Enable */ 14 #define PICR_FEIE (1 << 3) /* FIFO Error Interrupt Enable */ 15 #define PICR_FSRIE (1 << 1) /* FIFO Service Request Interrupt Enable */ 18 #define MCCR_FEIE (1 << 3) /* FIFO Error Interrupt Enable */ 19 #define MCCR_FSRIE (1 << 1) /* FIFO Service Request Interrupt Enable */ 38 #define POSR_FIFOE (1 << 4) /* FIFO error */ 39 #define POSR_FSR (1 << 2) /* FIFO Service Request */ 42 #define PISR_FIFOE (1 << 4) /* FIFO error */ 44 #define PISR_FSR (1 << 2) /* FIFO Service Request */ [all …]
|
/openbmc/linux/drivers/spi/ |
H A D | spi-mpc512x-psc.c | 55 struct mpc512x_psc_fifo __iomem *fifo; member 147 struct mpc512x_psc_fifo __iomem *fifo = mps->fifo; in mpc512x_psc_spi_transfer_rxtx() local 167 fifosz = MPC512x_PSC_FIFO_SZ(in_be32(&fifo->txsz)); in mpc512x_psc_spi_transfer_rxtx() 169 fifosz = MPC512x_PSC_FIFO_SZ(in_be32(&fifo->rxsz)); in mpc512x_psc_spi_transfer_rxtx() 170 fifosz -= in_be32(&fifo->rxcnt) + 1; in mpc512x_psc_spi_transfer_rxtx() 174 /* fill the TX FIFO */ in mpc512x_psc_spi_transfer_rxtx() 178 setbits32(&fifo->txcmd, in mpc512x_psc_spi_transfer_rxtx() 180 out_8(&fifo->txdata_8, data); in mpc512x_psc_spi_transfer_rxtx() 184 /* have the ISR trigger when the TX FIFO is empty */ in mpc512x_psc_spi_transfer_rxtx() 186 out_be32(&fifo->txisr, MPC512x_PSC_FIFO_EMPTY); in mpc512x_psc_spi_transfer_rxtx() [all …]
|