Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by |
| 6 | * the Free Software Foundation; either version 2 of the License, or |
| 7 | * (at your option) any later version. |
| 8 | */ |
| 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 | |
| 16 | |
| 17 | void HvCall_writeLogBuffer(const void *buffer, u64 len) |
| 18 | { |
| 19 | struct HvLpBufferList hv_buf; |
| 20 | u64 left_this_page; |
| 21 | u64 cur = virt_to_abs(buffer); |
| 22 | |
| 23 | while (len) { |
| 24 | hv_buf.addr = cur; |
| 25 | left_this_page = ((cur & PAGE_MASK) + PAGE_SIZE) - cur; |
| 26 | if (left_this_page > len) |
| 27 | left_this_page = len; |
| 28 | hv_buf.len = left_this_page; |
| 29 | len -= left_this_page; |
| 30 | HvCall2(HvCallBaseWriteLogBuffer, |
| 31 | virt_to_abs(&hv_buf), |
| 32 | left_this_page); |
| 33 | cur = (cur & PAGE_MASK) + PAGE_SIZE; |
| 34 | } |
| 35 | } |