1 /*****************************************************************************
2 * Fast function for filling cache-inhibited memory regions via h-call.
4 * Copyright 2015 Red Hat, Inc.
6 * This program and the accompanying materials
7 * are made available under the terms of the BSD License
8 * which accompanies this distribution, and is available at
9 * http://www.opensource.org/licenses/bsd-license.php
12 * Thomas Huth, Red Hat Inc. - initial implementation
13 *****************************************************************************/
18 typedef unsigned long type_u;
21 * fast_rfill is the implementation of the FAST_RFILL macro with h-calls.
22 * This is defined here instead of cache.h since we need a temporary
23 * local buffer - and that caused stack size problems in engine() when
24 * we used it directly in the FAST_RFILL macro.
26 void fast_rfill(char *dst, long size, char pat)
30 memset(buf, pat, size < sizeof(buf) ? size : sizeof(buf));
32 while (size > sizeof(buf)) {
33 FAST_MRMOVE(buf, dst, sizeof(buf));
37 FAST_MRMOVE(buf, dst, size);