blob: f476d71194fac1c0bebc9f5bcb8861ff71731fde [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 * 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>
Kelly Daly1da44032005-11-01 16:59:20 +110012#include <asm/iseries/hv_call.h>
Kelly Daly50592f52005-11-02 11:37:22 +110013#include <asm/iseries/hv_call_sc.h>
Kelly Daly1ec65d72005-11-02 13:46:07 +110014#include <asm/iseries/hv_types.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070015
16
17void 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;
Benjamin Herrenschmidt3c726f82005-11-07 11:06:55 +110025 left_this_page = ((cur & HW_PAGE_MASK) + HW_PAGE_SIZE) - cur;
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 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);
Benjamin Herrenschmidt3c726f82005-11-07 11:06:55 +110033 cur = (cur & HW_PAGE_MASK) + HW_PAGE_SIZE;
Linus Torvalds1da177e2005-04-16 15:20:36 -070034 }
35}