diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2005-09-28 00:17:40 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2005-09-28 00:17:40 +1000 |
commit | 99a2379cdddcc4e8579e70deb80479450ed65d49 (patch) | |
tree | d5c40a1e7ffabb87c3b1f1ae510eac80f4b52d05 /arch/powerpc/platforms/iseries/hvlog.c | |
parent | 2952bc7c896ec76a20e18321e2be40a694a73a78 (diff) |
powerpc: move hvCall.s to powerpc/platforms/iseries
Rename it to hvcall.S and (so I can do that) rename hvcall.c
to hvlog.c - a more appropriate name.
Do some white space cleanups.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'arch/powerpc/platforms/iseries/hvlog.c')
-rw-r--r-- | arch/powerpc/platforms/iseries/hvlog.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/iseries/hvlog.c b/arch/powerpc/platforms/iseries/hvlog.c new file mode 100644 index 00000000000..f61e2e9ac9e --- /dev/null +++ b/arch/powerpc/platforms/iseries/hvlog.c @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2001 Mike Corrigan IBM Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#include <asm/page.h> +#include <asm/abs_addr.h> +#include <asm/iSeries/HvCall.h> +#include <asm/iSeries/HvCallSc.h> +#include <asm/iSeries/HvTypes.h> + + +void HvCall_writeLogBuffer(const void *buffer, u64 len) +{ + struct HvLpBufferList hv_buf; + u64 left_this_page; + u64 cur = virt_to_abs(buffer); + + while (len) { + hv_buf.addr = cur; + left_this_page = ((cur & PAGE_MASK) + PAGE_SIZE) - cur; + if (left_this_page > len) + left_this_page = len; + hv_buf.len = left_this_page; + len -= left_this_page; + HvCall2(HvCallBaseWriteLogBuffer, + virt_to_abs(&hv_buf), + left_this_page); + cur = (cur & PAGE_MASK) + PAGE_SIZE; + } +} |