Lines Matching +full:buffer +full:- +full:size

1 // SPDX-License-Identifier: GPL-2.0-or-later
14 unsigned int address, unsigned int size) in snd_gus_dram_poke() argument
18 char buffer[256], *pbuffer; in snd_gus_dram_poke() local
20 while (size > 0) { in snd_gus_dram_poke()
21 size1 = size > sizeof(buffer) ? sizeof(buffer) : size; in snd_gus_dram_poke()
22 if (copy_from_user(buffer, _buffer, size1)) in snd_gus_dram_poke()
23 return -EFAULT; in snd_gus_dram_poke()
24 if (gus->interwave) { in snd_gus_dram_poke()
25 spin_lock_irqsave(&gus->reg_lock, flags); in snd_gus_dram_poke()
28 outsb(GUSP(gus, DRAM), buffer, size1); in snd_gus_dram_poke()
29 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_gus_dram_poke()
32 pbuffer = buffer; in snd_gus_dram_poke()
34 while (size2--) in snd_gus_dram_poke()
37 size -= size1; in snd_gus_dram_poke()
44 int snd_gus_dram_write(struct snd_gus_card *gus, char __user *buffer, in snd_gus_dram_write() argument
45 unsigned int address, unsigned int size) in snd_gus_dram_write() argument
47 return snd_gus_dram_poke(gus, buffer, address, size); in snd_gus_dram_write()
51 unsigned int address, unsigned int size, in snd_gus_dram_peek() argument
56 char buffer[256], *pbuffer; in snd_gus_dram_peek() local
58 while (size > 0) { in snd_gus_dram_peek()
59 size1 = size > sizeof(buffer) ? sizeof(buffer) : size; in snd_gus_dram_peek()
60 if (gus->interwave) { in snd_gus_dram_peek()
61 spin_lock_irqsave(&gus->reg_lock, flags); in snd_gus_dram_peek()
64 insb(GUSP(gus, DRAM), buffer, size1); in snd_gus_dram_peek()
66 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_gus_dram_peek()
69 pbuffer = buffer; in snd_gus_dram_peek()
71 while (size2--) in snd_gus_dram_peek()
74 if (copy_to_user(_buffer, buffer, size1)) in snd_gus_dram_peek()
75 return -EFAULT; in snd_gus_dram_peek()
76 size -= size1; in snd_gus_dram_peek()
82 int snd_gus_dram_read(struct snd_gus_card *gus, char __user *buffer, in snd_gus_dram_read() argument
83 unsigned int address, unsigned int size, in snd_gus_dram_read() argument
86 return snd_gus_dram_peek(gus, buffer, address, size, rom); in snd_gus_dram_read()