HvCall.c 951 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * HvCall.c
  3. * Copyright (C) 2001 Mike Corrigan IBM Corporation
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. */
  10. #include <asm/page.h>
  11. #include <asm/abs_addr.h>
  12. #include <asm/iSeries/HvCall.h>
  13. #include <asm/iSeries/HvCallSc.h>
  14. #include <asm/iSeries/HvTypes.h>
  15. void HvCall_writeLogBuffer(const void *buffer, u64 len)
  16. {
  17. struct HvLpBufferList hv_buf;
  18. u64 left_this_page;
  19. u64 cur = virt_to_abs(buffer);
  20. while (len) {
  21. hv_buf.addr = cur;
  22. left_this_page = ((cur & PAGE_MASK) + PAGE_SIZE) - cur;
  23. if (left_this_page > len)
  24. left_this_page = len;
  25. hv_buf.len = left_this_page;
  26. len -= left_this_page;
  27. HvCall2(HvCallBaseWriteLogBuffer,
  28. virt_to_abs(&hv_buf),
  29. left_this_page);
  30. cur = (cur & PAGE_MASK) + PAGE_SIZE;
  31. }
  32. }