Path: blob/master/arch/powerpc/platforms/iseries/hvlog.c
10820 views
/*1* Copyright (C) 2001 Mike Corrigan IBM Corporation2*3* This program is free software; you can redistribute it and/or modify4* it under the terms of the GNU General Public License as published by5* the Free Software Foundation; either version 2 of the License, or6* (at your option) any later version.7*/89#include <asm/page.h>10#include <asm/abs_addr.h>11#include <asm/iseries/hv_call.h>12#include <asm/iseries/hv_call_sc.h>13#include <asm/iseries/hv_types.h>141516void HvCall_writeLogBuffer(const void *buffer, u64 len)17{18struct HvLpBufferList hv_buf;19u64 left_this_page;20u64 cur = virt_to_abs(buffer);2122while (len) {23hv_buf.addr = cur;24left_this_page = ((cur & HW_PAGE_MASK) + HW_PAGE_SIZE) - cur;25if (left_this_page > len)26left_this_page = len;27hv_buf.len = left_this_page;28len -= left_this_page;29HvCall2(HvCallBaseWriteLogBuffer,30virt_to_abs(&hv_buf),31left_this_page);32cur = (cur & HW_PAGE_MASK) + HW_PAGE_SIZE;33}34}353637