io.c 794 B

123456789101112131415161718192021222324252627282930
  1. /* MN10300 Misaligned multibyte-word I/O
  2. *
  3. * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public Licence
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the Licence, or (at your option) any later version.
  10. */
  11. #include <linux/module.h>
  12. #include <linux/string.h>
  13. #include <linux/kernel.h>
  14. #include <asm/io.h>
  15. /*
  16. * output data from a potentially misaligned buffer
  17. */
  18. void __outsl(unsigned long addr, const void *buffer, int count)
  19. {
  20. const unsigned char *buf = buffer;
  21. unsigned long val;
  22. while (count--) {
  23. memcpy(&val, buf, 4);
  24. outl(val, addr);
  25. buf += 4;
  26. }
  27. }
  28. EXPORT_SYMBOL(__outsl);