/*-
* Copyright (c) 1993 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
/*
* Functions to provide access to special i386 instructions.
* used in preference to this.
*/
#ifndef _MACHINE_CPUFUNC_H_
#define _MACHINE_CPUFUNC_H_
#ifndef _SYS_CDEFS_H_
#endif
struct region_descriptor;
#if defined(__GNUCLIKE_ASM) && defined(__CC_SUPPORTS___INLINE)
static __inline void
breakpoint(void)
{
}
{
return (result);
}
{
return (result);
}
static __inline void
{
}
static __inline void
{
}
static __inline void
clts(void)
{
}
static __inline void
disable_intr(void)
{
}
static __inline void
{
: "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3])
: "0" (ax));
}
static __inline void
{
: "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3])
}
static __inline void
enable_intr(void)
{
}
static __inline void
{
}
static __inline void
{
}
static __inline void
lfence(void)
{
}
static __inline void
mfence(void)
{
}
#ifdef _KERNEL
#define HAVE_INLINE_FFS
static __inline int
{
/*
* Note that gcc-2's builtin ffs would be used if we didn't declare
* this inline or turn off the builtin. The builtin is faster but
* broken in gcc-2.4.5 and slower but working in gcc-2.5 and later
* versions.
*/
}
#define HAVE_INLINE_FFSL
static __inline int
{
}
#define HAVE_INLINE_FLS
static __inline int
{
}
#define HAVE_INLINE_FLSL
static __inline int
{
}
#endif /* _KERNEL */
static __inline void
halt(void)
{
}
{
return (data);
}
{
return (data);
}
static __inline void
{
: "d" (port)
: "memory");
}
static __inline void
{
: "d" (port)
: "memory");
}
static __inline void
{
: "d" (port)
: "memory");
}
static __inline void
invd(void)
{
}
{
return (data);
}
static __inline void
{
}
static __inline void
{
}
static __inline void
{
: "d" (port));
}
static __inline void
{
: "d" (port));
}
static __inline void
{
: "d" (port));
}
static __inline void
{
}
static __inline void
ia32_pause(void)
{
}
read_eflags(void)
{
return (ef);
}
{
return (rv);
}
{
return (low);
}
{
return (rv);
}
rdtsc(void)
{
return (rv);
}
rdtsc32(void)
{
return (rv);
}
static __inline void
wbinvd(void)
{
}
static __inline void
{
}
static __inline void
{
}
static __inline void
{
}
rcr0(void)
{
return (data);
}
rcr2(void)
{
return (data);
}
static __inline void
{
}
rcr3(void)
{
return (data);
}
static __inline void
{
}
rcr4(void)
{
return (data);
}
{
}
static __inline void
{
}
/*
* Global TLB flush (except for thise for pages marked PG_G)
*/
static __inline void
invltlb(void)
{
}
/*
* TLB flush for an individual page (even if it has PG_G).
* Only works on 486+ CPUs (i386 does not have PG_G).
*/
static __inline void
{
}
rfs(void)
{
return (sel);
}
rgdt(void)
{
return (gdtr);
}
rgs(void)
{
return (sel);
}
ridt(void)
{
return (idtr);
}
rldt(void)
{
return (ldtr);
}
rss(void)
{
return (sel);
}
rtr(void)
{
return (tr);
}
static __inline void
{
}
static __inline void
{
}
static __inline void
{
}
static __inline void
{
}
static __inline void
{
}
rdr0(void)
{
return (data);
}
static __inline void
{
}
rdr1(void)
{
return (data);
}
static __inline void
{
}
rdr2(void)
{
return (data);
}
static __inline void
{
}
rdr3(void)
{
return (data);
}
static __inline void
{
}
rdr4(void)
{
return (data);
}
static __inline void
{
}
rdr5(void)
{
return (data);
}
static __inline void
{
}
rdr6(void)
{
return (data);
}
static __inline void
{
}
rdr7(void)
{
return (data);
}
static __inline void
{
}
{
return inb(0x23);
}
static __inline void
{
}
static __inline register_t
intr_disable(void)
{
eflags = read_eflags();
disable_intr();
return (eflags);
}
static __inline void
{
}
#else /* !(__GNUCLIKE_ASM && __CC_SUPPORTS___INLINE) */
int breakpoint(void);
void clts(void);
void disable_intr(void);
void enable_intr(void);
void halt(void);
void ia32_pause(void);
register_t intr_disable(void);
void invd(void);
void invltlb(void);
u_int read_eflags(void);
void wbinvd(void);
#endif /* __GNUCLIKE_ASM && __CC_SUPPORTS___INLINE */
void reset_dbregs(void);
#ifdef _KERNEL
#endif
#endif /* !_MACHINE_CPUFUNC_H_ */