diff options
author | Michal Simek <monstr@monstr.eu> | 2011-05-03 04:33:07 -0400 |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2012-10-04 08:23:47 -0400 |
commit | 9998517a2789850e4e48bad6ada4de1f6c5a760d (patch) | |
tree | 90a6cd060eadba570d7936831f7b5c072e234708 /arch | |
parent | 191d5eca2405b58cece0e572f694abd1230b0efe (diff) |
microblaze: Add support for ioreadXX/iowriteXX_rep
Reuse versions from asm-generic functions.
Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/microblaze/include/asm/io.h | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/arch/microblaze/include/asm/io.h b/arch/microblaze/include/asm/io.h index 8cdac14b55b0..e4a797478603 100644 --- a/arch/microblaze/include/asm/io.h +++ b/arch/microblaze/include/asm/io.h | |||
@@ -248,4 +248,94 @@ static inline void __iomem *__ioremap(phys_addr_t address, unsigned long size, | |||
248 | #define ioport_map(port, nr) ((void __iomem *)(port)) | 248 | #define ioport_map(port, nr) ((void __iomem *)(port)) |
249 | #define ioport_unmap(addr) | 249 | #define ioport_unmap(addr) |
250 | 250 | ||
251 | /* from asm-generic/io.h */ | ||
252 | #ifndef insb | ||
253 | static inline void insb(unsigned long addr, void *buffer, int count) | ||
254 | { | ||
255 | if (count) { | ||
256 | u8 *buf = buffer; | ||
257 | do { | ||
258 | u8 x = inb(addr); | ||
259 | *buf++ = x; | ||
260 | } while (--count); | ||
261 | } | ||
262 | } | ||
263 | #endif | ||
264 | |||
265 | #ifndef insw | ||
266 | static inline void insw(unsigned long addr, void *buffer, int count) | ||
267 | { | ||
268 | if (count) { | ||
269 | u16 *buf = buffer; | ||
270 | do { | ||
271 | u16 x = inw(addr); | ||
272 | *buf++ = x; | ||
273 | } while (--count); | ||
274 | } | ||
275 | } | ||
276 | #endif | ||
277 | |||
278 | #ifndef insl | ||
279 | static inline void insl(unsigned long addr, void *buffer, int count) | ||
280 | { | ||
281 | if (count) { | ||
282 | u32 *buf = buffer; | ||
283 | do { | ||
284 | u32 x = inl(addr); | ||
285 | *buf++ = x; | ||
286 | } while (--count); | ||
287 | } | ||
288 | } | ||
289 | #endif | ||
290 | |||
291 | #ifndef outsb | ||
292 | static inline void outsb(unsigned long addr, const void *buffer, int count) | ||
293 | { | ||
294 | if (count) { | ||
295 | const u8 *buf = buffer; | ||
296 | do { | ||
297 | outb(*buf++, addr); | ||
298 | } while (--count); | ||
299 | } | ||
300 | } | ||
301 | #endif | ||
302 | |||
303 | #ifndef outsw | ||
304 | static inline void outsw(unsigned long addr, const void *buffer, int count) | ||
305 | { | ||
306 | if (count) { | ||
307 | const u16 *buf = buffer; | ||
308 | do { | ||
309 | outw(*buf++, addr); | ||
310 | } while (--count); | ||
311 | } | ||
312 | } | ||
313 | #endif | ||
314 | |||
315 | #ifndef outsl | ||
316 | static inline void outsl(unsigned long addr, const void *buffer, int count) | ||
317 | { | ||
318 | if (count) { | ||
319 | const u32 *buf = buffer; | ||
320 | do { | ||
321 | outl(*buf++, addr); | ||
322 | } while (--count); | ||
323 | } | ||
324 | } | ||
325 | #endif | ||
326 | |||
327 | #define ioread8_rep(p, dst, count) \ | ||
328 | insb((unsigned long) (p), (dst), (count)) | ||
329 | #define ioread16_rep(p, dst, count) \ | ||
330 | insw((unsigned long) (p), (dst), (count)) | ||
331 | #define ioread32_rep(p, dst, count) \ | ||
332 | insl((unsigned long) (p), (dst), (count)) | ||
333 | |||
334 | #define iowrite8_rep(p, src, count) \ | ||
335 | outsb((unsigned long) (p), (src), (count)) | ||
336 | #define iowrite16_rep(p, src, count) \ | ||
337 | outsw((unsigned long) (p), (src), (count)) | ||
338 | #define iowrite32_rep(p, src, count) \ | ||
339 | outsl((unsigned long) (p), (src), (count)) | ||
340 | |||
251 | #endif /* _ASM_MICROBLAZE_IO_H */ | 341 | #endif /* _ASM_MICROBLAZE_IO_H */ |