1863f90drrs/*-
282650adimp * Copyright (c) 2016-2018 Netflix, Inc.
3863f90drrs *
4863f90drrs * Redistribution and use in source and binary forms, with or without
5863f90drrs * modification, are permitted provided that the following conditions
6863f90drrs * are met:
7863f90drrs * 1. Redistributions of source code must retain the above copyright
8863f90drrs *    notice, this list of conditions and the following disclaimer.
9863f90drrs * 2. Redistributions in binary form must reproduce the above copyright
10863f90drrs *    notice, this list of conditions and the following disclaimer in the
11863f90drrs *    documentation and/or other materials provided with the distribution.
12863f90drrs *
13863f90drrs * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
14863f90drrs * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15863f90drrs * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16863f90drrs * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
17863f90drrs * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18863f90drrs * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19863f90drrs * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20863f90drrs * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21863f90drrs * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22863f90drrs * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23863f90drrs * SUCH DAMAGE.
24863f90drrs *
25e08b855imp * $FreeBSD$
26863f90drrs */
27e08b855imp#ifndef __kern_prefetch_h__
28863f90drrs#define __kern_prefetch_h__
29863f90drrs#ifdef _KERNEL
30863f90drrs
31863f90drrsstatic __inline void
32863f90drrskern_prefetch(const volatile void *addr, void* before)
33863f90drrs{
34863f90drrs#if defined(__amd64__)
35863f90drrs	__asm __volatile("prefetcht1 (%1)":"=rm"(*((int32_t *)before)):"r"(addr):);
36863f90drrs#else
374f878c4rrs/*	__builtin_prefetch(addr);*/
38863f90drrs#endif
39863f90drrs}
40863f90drrs
41e08b855imp#endif /* _KERNEL */
42e08b855imp#endif /* __kern_prefetch_h__ */
43