13c4dd356SDavid Greenman /*- 23c4dd356SDavid Greenman * Copyright (c) 1993 The Regents of the University of California. 33c4dd356SDavid Greenman * All rights reserved. 43c4dd356SDavid Greenman * 53c4dd356SDavid Greenman * Redistribution and use in source and binary forms, with or without 63c4dd356SDavid Greenman * modification, are permitted provided that the following conditions 73c4dd356SDavid Greenman * are met: 83c4dd356SDavid Greenman * 1. Redistributions of source code must retain the above copyright 93c4dd356SDavid Greenman * notice, this list of conditions and the following disclaimer. 103c4dd356SDavid Greenman * 2. Redistributions in binary form must reproduce the above copyright 113c4dd356SDavid Greenman * notice, this list of conditions and the following disclaimer in the 123c4dd356SDavid Greenman * documentation and/or other materials provided with the distribution. 133c4dd356SDavid Greenman * 3. All advertising materials mentioning features or use of this software 143c4dd356SDavid Greenman * must display the following acknowledgement: 153c4dd356SDavid Greenman * This product includes software developed by the University of 163c4dd356SDavid Greenman * California, Berkeley and its contributors. 173c4dd356SDavid Greenman * 4. Neither the name of the University nor the names of its contributors 183c4dd356SDavid Greenman * may be used to endorse or promote products derived from this software 193c4dd356SDavid Greenman * without specific prior written permission. 203c4dd356SDavid Greenman * 213c4dd356SDavid Greenman * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 223c4dd356SDavid Greenman * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 233c4dd356SDavid Greenman * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 243c4dd356SDavid Greenman * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 253c4dd356SDavid Greenman * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 263c4dd356SDavid Greenman * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 273c4dd356SDavid Greenman * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 283c4dd356SDavid Greenman * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 293c4dd356SDavid Greenman * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 303c4dd356SDavid Greenman * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 313c4dd356SDavid Greenman * SUCH DAMAGE. 323c4dd356SDavid Greenman * 332838c968SDavid Greenman * $Id: cpufunc.h,v 1.42 1995/12/03 13:45:27 bde Exp $ 343c4dd356SDavid Greenman */ 353c4dd356SDavid Greenman 365b81b6b3SRodney W. Grimes /* 375b81b6b3SRodney W. Grimes * Functions to provide access to special i386 instructions. 385b81b6b3SRodney W. Grimes */ 395b81b6b3SRodney W. Grimes 406e393973SGarrett Wollman #ifndef _MACHINE_CPUFUNC_H_ 41004bedebSBruce Evans #define _MACHINE_CPUFUNC_H_ 426e393973SGarrett Wollman 435b81b6b3SRodney W. Grimes #include <sys/cdefs.h> 445b81b6b3SRodney W. Grimes #include <sys/types.h> 455b81b6b3SRodney W. Grimes 46004bedebSBruce Evans #include <machine/spl.h> /* XXX belongs elsewhere */ 47d2306226SDavid Greenman 485b81b6b3SRodney W. Grimes #ifdef __GNUC__ 495b81b6b3SRodney W. Grimes 50004bedebSBruce Evans #ifdef BDE_DEBUGGER 515b81b6b3SRodney W. Grimes extern int bdb_exists; 525b81b6b3SRodney W. Grimes 53004bedebSBruce Evans static __inline int 54004bedebSBruce Evans bdb(void) 55004bedebSBruce Evans { 565b81b6b3SRodney W. Grimes if (!bdb_exists) 575b81b6b3SRodney W. Grimes return (0); 58004bedebSBruce Evans __asm __volatile("int $3"); 595b81b6b3SRodney W. Grimes return (1); 605b81b6b3SRodney W. Grimes } 61004bedebSBruce Evans #endif /* BDE_DEBUGGER */ 625b81b6b3SRodney W. Grimes 63004bedebSBruce Evans static __inline void 645b81b6b3SRodney W. Grimes disable_intr(void) 655b81b6b3SRodney W. Grimes { 668966b85cSJohn Dyson __asm __volatile("cli" : : : "memory"); 675b81b6b3SRodney W. Grimes } 685b81b6b3SRodney W. Grimes 69004bedebSBruce Evans static __inline void 705b81b6b3SRodney W. Grimes enable_intr(void) 715b81b6b3SRodney W. Grimes { 72fadc51bdSBruce Evans __asm __volatile("sti"); 735b81b6b3SRodney W. Grimes } 745b81b6b3SRodney W. Grimes 75004bedebSBruce Evans #define HAVE_INLINE_FFS 76004bedebSBruce Evans 77004bedebSBruce Evans static __inline int 78004bedebSBruce Evans ffs(int mask) 79004bedebSBruce Evans { 80004bedebSBruce Evans int result; 81004bedebSBruce Evans /* 82004bedebSBruce Evans * bsfl turns out to be not all that slow on 486's. It can beaten 83004bedebSBruce Evans * using a binary search to reduce to 4 bits and then a table lookup, 84004bedebSBruce Evans * but only if the code is inlined and in the cache, and the code 85004bedebSBruce Evans * is quite large so inlining it probably busts the cache. 86004bedebSBruce Evans * 87004bedebSBruce Evans * Note that gcc-2's builtin ffs would be used if we didn't declare 88004bedebSBruce Evans * this inline or turn off the builtin. The builtin is faster but 89004bedebSBruce Evans * broken in gcc-2.4.5 and slower but working in gcc-2.5 and 2.6. 90004bedebSBruce Evans */ 91004bedebSBruce Evans __asm __volatile("testl %0,%0; je 1f; bsfl %0,%0; incl %0; 1:" 92004bedebSBruce Evans : "=r" (result) : "0" (mask)); 93004bedebSBruce Evans return (result); 94004bedebSBruce Evans } 95004bedebSBruce Evans 96004bedebSBruce Evans #if __GNUC__ < 2 97004bedebSBruce Evans 98004bedebSBruce Evans #define inb(port) inbv(port) 99004bedebSBruce Evans #define outb(port, data) outbv(port, data) 100004bedebSBruce Evans 101004bedebSBruce Evans #else /* __GNUC >= 2 */ 102004bedebSBruce Evans 103004bedebSBruce Evans /* 1048089a043SBruce Evans * The following complications are to get around gcc not having a 1058089a043SBruce Evans * constraint letter for the range 0..255. We still put "d" in the 1068089a043SBruce Evans * constraint because "i" isn't a valid constraint when the port 1078089a043SBruce Evans * isn't constant. This only matters for -O0 because otherwise 1088089a043SBruce Evans * the non-working version gets optimized away. 1098089a043SBruce Evans * 110004bedebSBruce Evans * Use an expression-statement instead of a conditional expression 111004bedebSBruce Evans * because gcc-2.6.0 would promote the operands of the conditional 112004bedebSBruce Evans * and produce poor code for "if ((inb(var) & const1) == const2)". 113004bedebSBruce Evans */ 114004bedebSBruce Evans #define inb(port) ({ \ 115004bedebSBruce Evans u_char _data; \ 116004bedebSBruce Evans if (__builtin_constant_p((int) (port)) && (port) < 256ul) \ 117004bedebSBruce Evans _data = inbc(port); \ 118004bedebSBruce Evans else \ 119004bedebSBruce Evans _data = inbv(port); \ 120004bedebSBruce Evans _data; }) 121004bedebSBruce Evans 122004bedebSBruce Evans #define outb(port, data) \ 123004bedebSBruce Evans (__builtin_constant_p((int) (port)) && (port) < 256ul \ 124004bedebSBruce Evans ? outbc(port, data) : outbv(port, data)) 125004bedebSBruce Evans 126004bedebSBruce Evans static __inline u_char 127004bedebSBruce Evans inbc(u_int port) 128004bedebSBruce Evans { 129004bedebSBruce Evans u_char data; 130004bedebSBruce Evans 1318089a043SBruce Evans __asm __volatile("inb %1,%0" : "=a" (data) : "id" ((u_short)(port))); 132004bedebSBruce Evans return (data); 133004bedebSBruce Evans } 134004bedebSBruce Evans 135004bedebSBruce Evans static __inline void 136004bedebSBruce Evans outbc(u_int port, u_char data) 137004bedebSBruce Evans { 1388089a043SBruce Evans __asm __volatile("outb %0,%1" : : "a" (data), "id" ((u_short)(port))); 139004bedebSBruce Evans } 140004bedebSBruce Evans 141004bedebSBruce Evans #endif /* __GNUC <= 2 */ 142004bedebSBruce Evans 143004bedebSBruce Evans static __inline u_char 144004bedebSBruce Evans inbv(u_int port) 145004bedebSBruce Evans { 146004bedebSBruce Evans u_char data; 147004bedebSBruce Evans /* 148004bedebSBruce Evans * We use %%dx and not %1 here because i/o is done at %dx and not at 149004bedebSBruce Evans * %edx, while gcc generates inferior code (movw instead of movl) 150004bedebSBruce Evans * if we tell it to load (u_short) port. 151004bedebSBruce Evans */ 152004bedebSBruce Evans __asm __volatile("inb %%dx,%0" : "=a" (data) : "d" (port)); 153004bedebSBruce Evans return (data); 154004bedebSBruce Evans } 155004bedebSBruce Evans 156004bedebSBruce Evans static __inline u_long 157004bedebSBruce Evans inl(u_int port) 158004bedebSBruce Evans { 159004bedebSBruce Evans u_long data; 160004bedebSBruce Evans 161004bedebSBruce Evans __asm __volatile("inl %%dx,%0" : "=a" (data) : "d" (port)); 162004bedebSBruce Evans return (data); 163004bedebSBruce Evans } 164004bedebSBruce Evans 165004bedebSBruce Evans static __inline void 166004bedebSBruce Evans insb(u_int port, void *addr, size_t cnt) 167004bedebSBruce Evans { 168004bedebSBruce Evans __asm __volatile("cld; rep; insb" 169004bedebSBruce Evans : : "d" (port), "D" (addr), "c" (cnt) 170004bedebSBruce Evans : "di", "cx", "memory"); 171004bedebSBruce Evans } 172004bedebSBruce Evans 173004bedebSBruce Evans static __inline void 174004bedebSBruce Evans insw(u_int port, void *addr, size_t cnt) 175004bedebSBruce Evans { 176004bedebSBruce Evans __asm __volatile("cld; rep; insw" 177004bedebSBruce Evans : : "d" (port), "D" (addr), "c" (cnt) 178004bedebSBruce Evans : "di", "cx", "memory"); 179004bedebSBruce Evans } 180004bedebSBruce Evans 181004bedebSBruce Evans static __inline void 182004bedebSBruce Evans insl(u_int port, void *addr, size_t cnt) 183004bedebSBruce Evans { 184004bedebSBruce Evans __asm __volatile("cld; rep; insl" 185004bedebSBruce Evans : : "d" (port), "D" (addr), "c" (cnt) 186004bedebSBruce Evans : "di", "cx", "memory"); 187004bedebSBruce Evans } 188004bedebSBruce Evans 189004bedebSBruce Evans static __inline u_short 190004bedebSBruce Evans inw(u_int port) 191004bedebSBruce Evans { 192004bedebSBruce Evans u_short data; 193004bedebSBruce Evans 194004bedebSBruce Evans __asm __volatile("inw %%dx,%0" : "=a" (data) : "d" (port)); 195004bedebSBruce Evans return (data); 196004bedebSBruce Evans } 197004bedebSBruce Evans 1980ee893ebSBruce Evans static __inline unsigned 1990ee893ebSBruce Evans loadandclear(u_int *addr) 2000ee893ebSBruce Evans { 2010ee893ebSBruce Evans u_int result; 2020ee893ebSBruce Evans 2030ee893ebSBruce Evans __asm __volatile("xorl %0,%0; xchgl %1,%0" 20430fd0561SDavid Greenman : "=&r" (result) : "m" (*addr)); 2050ee893ebSBruce Evans return (result); 2060ee893ebSBruce Evans } 2070ee893ebSBruce Evans 208004bedebSBruce Evans static __inline void 209004bedebSBruce Evans outbv(u_int port, u_char data) 210004bedebSBruce Evans { 211004bedebSBruce Evans u_char al; 212004bedebSBruce Evans /* 213004bedebSBruce Evans * Use an unnecessary assignment to help gcc's register allocator. 214004bedebSBruce Evans * This make a large difference for gcc-1.40 and a tiny difference 215004bedebSBruce Evans * for gcc-2.6.0. For gcc-1.40, al had to be ``asm("ax")'' for 216004bedebSBruce Evans * best results. gcc-2.6.0 can't handle this. 217004bedebSBruce Evans */ 218004bedebSBruce Evans al = data; 219004bedebSBruce Evans __asm __volatile("outb %0,%%dx" : : "a" (al), "d" (port)); 220004bedebSBruce Evans } 221004bedebSBruce Evans 222004bedebSBruce Evans static __inline void 223004bedebSBruce Evans outl(u_int port, u_long data) 224004bedebSBruce Evans { 225004bedebSBruce Evans /* 226004bedebSBruce Evans * outl() and outw() aren't used much so we haven't looked at 227004bedebSBruce Evans * possible micro-optimizations such as the unnecessary 228004bedebSBruce Evans * assignment for them. 229004bedebSBruce Evans */ 230004bedebSBruce Evans __asm __volatile("outl %0,%%dx" : : "a" (data), "d" (port)); 231004bedebSBruce Evans } 232004bedebSBruce Evans 233004bedebSBruce Evans static __inline void 234004bedebSBruce Evans outsb(u_int port, void *addr, size_t cnt) 235004bedebSBruce Evans { 236004bedebSBruce Evans __asm __volatile("cld; rep; outsb" 237004bedebSBruce Evans : : "d" (port), "S" (addr), "c" (cnt) 238b5ba45f6SDavid Greenman : "si", "cx"); 239004bedebSBruce Evans } 240004bedebSBruce Evans 241004bedebSBruce Evans static __inline void 242004bedebSBruce Evans outsw(u_int port, void *addr, size_t cnt) 243004bedebSBruce Evans { 244004bedebSBruce Evans __asm __volatile("cld; rep; outsw" 245004bedebSBruce Evans : : "d" (port), "S" (addr), "c" (cnt) 246b5ba45f6SDavid Greenman : "si", "cx"); 247004bedebSBruce Evans } 248004bedebSBruce Evans 249004bedebSBruce Evans static __inline void 250004bedebSBruce Evans outsl(u_int port, void *addr, size_t cnt) 251004bedebSBruce Evans { 252004bedebSBruce Evans __asm __volatile("cld; rep; outsl" 253004bedebSBruce Evans : : "d" (port), "S" (addr), "c" (cnt) 254b5ba45f6SDavid Greenman : "si", "cx"); 255004bedebSBruce Evans } 256004bedebSBruce Evans 257004bedebSBruce Evans static __inline void 258004bedebSBruce Evans outw(u_int port, u_short data) 259004bedebSBruce Evans { 260004bedebSBruce Evans __asm __volatile("outw %0,%%dx" : : "a" (data), "d" (port)); 261004bedebSBruce Evans } 262004bedebSBruce Evans 263004bedebSBruce Evans static __inline void 264004bedebSBruce Evans pmap_update(void) 265004bedebSBruce Evans { 266004bedebSBruce Evans u_long temp; 267004bedebSBruce Evans /* 268004bedebSBruce Evans * This should be implemented as load_cr3(rcr3()) when load_cr3() 269004bedebSBruce Evans * is inlined. 270004bedebSBruce Evans */ 271fadc51bdSBruce Evans __asm __volatile("movl %%cr3, %0; movl %0, %%cr3" : "=r" (temp) 272fadc51bdSBruce Evans : : "memory"); 273004bedebSBruce Evans } 274004bedebSBruce Evans 275004bedebSBruce Evans static __inline u_long 276004bedebSBruce Evans rcr2(void) 277004bedebSBruce Evans { 278004bedebSBruce Evans u_long data; 279004bedebSBruce Evans 280004bedebSBruce Evans __asm __volatile("movl %%cr2,%0" : "=r" (data)); 281004bedebSBruce Evans return (data); 282004bedebSBruce Evans } 283004bedebSBruce Evans 284004bedebSBruce Evans static __inline u_long 285004bedebSBruce Evans read_eflags(void) 2865b81b6b3SRodney W. Grimes { 2878db02de8SPaul Richards u_long ef; 288004bedebSBruce Evans 289004bedebSBruce Evans __asm __volatile("pushfl; popl %0" : "=r" (ef)); 2908db02de8SPaul Richards return (ef); 2915b81b6b3SRodney W. Grimes } 2925b81b6b3SRodney W. Grimes 293004bedebSBruce Evans static __inline void 2948db02de8SPaul Richards write_eflags(u_long ef) 2955b81b6b3SRodney W. Grimes { 296004bedebSBruce Evans __asm __volatile("pushl %0; popfl" : : "r" (ef)); 2975b81b6b3SRodney W. Grimes } 2985b81b6b3SRodney W. Grimes 299004bedebSBruce Evans #else /* !__GNUC__ */ 3005b81b6b3SRodney W. Grimes 3015b81b6b3SRodney W. Grimes int bdb __P((void)); 3025b81b6b3SRodney W. Grimes void disable_intr __P((void)); 3035b81b6b3SRodney W. Grimes void enable_intr __P((void)); 3045b81b6b3SRodney W. Grimes u_char inb __P((u_int port)); 305004bedebSBruce Evans u_long inl __P((u_int port)); 306004bedebSBruce Evans void insb __P((u_int port, void *addr, size_t cnt)); 307004bedebSBruce Evans void insl __P((u_int port, void *addr, size_t cnt)); 308004bedebSBruce Evans void insw __P((u_int port, void *addr, size_t cnt)); 309004bedebSBruce Evans u_short inw __P((u_int port)); 3100ee893ebSBruce Evans u_int loadandclear __P((u_int *addr)); 311004bedebSBruce Evans void outb __P((u_int port, u_char data)); 312004bedebSBruce Evans void outl __P((u_int port, u_long data)); 313004bedebSBruce Evans void outsb __P((u_int port, void *addr, size_t cnt)); 314004bedebSBruce Evans void outsl __P((u_int port, void *addr, size_t cnt)); 315004bedebSBruce Evans void outsw __P((u_int port, void *addr, size_t cnt)); 316004bedebSBruce Evans void outw __P((u_int port, u_short data)); 317ceb91b3eSBruce Evans void pmap_update __P((void)); 318004bedebSBruce Evans u_long read_eflags __P((void)); 319004bedebSBruce Evans u_long rcr2 __P((void)); 320004bedebSBruce Evans void write_eflags __P((u_long ef)); 321004bedebSBruce Evans 3225b81b6b3SRodney W. Grimes #endif /* __GNUC__ */ 3235b81b6b3SRodney W. Grimes 324004bedebSBruce Evans /* 325004bedebSBruce Evans * XXX the following declarations document garbage in support.s. 326004bedebSBruce Evans * bcopy[bwx]() was used by pccons but isn't used now. 327004bedebSBruce Evans */ 328004bedebSBruce Evans void bcopyb __P((const void *from, void *to, size_t len)); 329004bedebSBruce Evans void bcopyw __P((const void *from, void *to, size_t len)); 330004bedebSBruce Evans void bcopyx __P((const void *from, void *to, size_t len, 331004bedebSBruce Evans int stride)); 332004bedebSBruce Evans 333004bedebSBruce Evans #if 0 334004bedebSBruce Evans /* 335004bedebSBruce Evans * These functions in support.s are declared elsewhere. 336004bedebSBruce Evans */ 337004bedebSBruce Evans void bcopy __P((const void *from, void *to, size_t len)); 338004bedebSBruce Evans void blkclr __P((void *buf, size_t len)); 339004bedebSBruce Evans void bzero __P((void *buf, size_t len)); 340004bedebSBruce Evans int copyin __P((void *udaddr, void *kaddr, size_t len)); 341004bedebSBruce Evans int copyinstr __P((void *udaddr, void *kaddr, size_t len, 342004bedebSBruce Evans size_t *lencopied)); 343004bedebSBruce Evans int copyout __P((void *kaddr, void *udaddr, size_t len)); 344004bedebSBruce Evans int copystr __P((void *kfaddr, void *kdaddr, size_t len, 345004bedebSBruce Evans size_t *lencopied)); 346004bedebSBruce Evans int fubyte __P((void *base)); 347004bedebSBruce Evans int fuswintr __P((void *base)); 348004bedebSBruce Evans int fuibyte __P((void *base)); 349004bedebSBruce Evans int fuword __P((void *base)); 350004bedebSBruce Evans struct region_descriptor; 351004bedebSBruce Evans void lgdt __P((struct region_descriptor *rdp)); 352004bedebSBruce Evans void lidt __P((struct region_descriptor *rdp)); 353004bedebSBruce Evans void lldt __P((u_short sel)); 354004bedebSBruce Evans /* 355004bedebSBruce Evans * longjmp() and setjmp() are only used by ddb. They probably shouldn't 356004bedebSBruce Evans * shouldn't be supported in the kernel. 357004bedebSBruce Evans */ 358004bedebSBruce Evans #include <setjmp.h> 359004bedebSBruce Evans void longjmp __P((jmp_buf jb, int rv)); 360004bedebSBruce Evans void ovbcopy __P((const void *from, void *to, size_t len); 361004bedebSBruce Evans int setjmp __P((jmp_buf jb)); 362004bedebSBruce Evans struct soft_segment_descriptor; 363004bedebSBruce Evans union descriptor; 364004bedebSBruce Evans int ssdtosd __P((struct soft_segment_descriptor *ssdp, 365004bedebSBruce Evans union descriptor *sdp)); 366004bedebSBruce Evans int subyte __P((void *base, int byte)); 367004bedebSBruce Evans int suibyte __P((void *base, int byte)); 368004bedebSBruce Evans int suswintr __P((void *base, int word)); 369004bedebSBruce Evans int suword __P((void *base, int word)); 370004bedebSBruce Evans 371004bedebSBruce Evans /* 372004bedebSBruce Evans * These functions in support.s are declared elsewhere, but never used. 373004bedebSBruce Evans * A silly amount of effort went into copyoutstr(). It's not worth 374004bedebSBruce Evans * maintaining, since the string length is usually known so copyout 375004bedebSBruce Evans * works better, or is easy to find so copyout() can be used. 376004bedebSBruce Evans */ 377004bedebSBruce Evans int copyoutstr __P((void *kaddr, void *udaddr, size_t len, 378004bedebSBruce Evans size_t *lencopied)); 379004bedebSBruce Evans int fuiword __P((void *base)); 380004bedebSBruce Evans int suiword __P((void *base, int word)); 381004bedebSBruce Evans 382004bedebSBruce Evans /* 383004bedebSBruce Evans * These functions in support.s are also in libkern.a and are declared in 384004bedebSBruce Evans * libkern.h. 385004bedebSBruce Evans * ffs() is built in to gcc-2 and was buggy in gcc-2.4.5 so we may may the 386004bedebSBruce Evans * buggy version if we don't replace it by an inline. 387004bedebSBruce Evans */ 388004bedebSBruce Evans int bcmp __P((const void *b1, const void *b2, size_t length)); 389004bedebSBruce Evans int ffs __P((int mask)); 390004bedebSBruce Evans #endif /* 0 */ 391004bedebSBruce Evans 392004bedebSBruce Evans /* 393004bedebSBruce Evans * These variables and functions in support.s are used. 394004bedebSBruce Evans */ 395004bedebSBruce Evans extern u_int atdevbase; /* offset in virtual memory of ISA io mem */ 396004bedebSBruce Evans 397004bedebSBruce Evans void filli __P((int pat, void *base, size_t cnt)); 398004bedebSBruce Evans void fillw __P((int /*u_short*/ pat, void *base, size_t cnt)); 399004bedebSBruce Evans int fusword __P((void *base)); 400004bedebSBruce Evans void load_cr0 __P((u_long cr0)); 401004bedebSBruce Evans void load_cr3 __P((u_long cr3)); 402004bedebSBruce Evans void ltr __P((u_short sel)); 403aaf08d94SGarrett Wollman u_int rcr0 __P((void)); 404004bedebSBruce Evans u_long rcr3 __P((void)); 405004bedebSBruce Evans int rtcin __P((int val)); 4065b81b6b3SRodney W. Grimes 407004bedebSBruce Evans /* 408004bedebSBruce Evans * These functions are NOT in support.s and should be declared elsewhere. 409004bedebSBruce Evans */ 410ff030ea1SBruce Evans void Debugger __P((const char *msg)); 411004bedebSBruce Evans u_long kvtop __P((void *addr)); 412004bedebSBruce Evans typedef void alias_for_inthand_t __P((u_int cs, u_int ef, u_int esp, 413004bedebSBruce Evans u_int ss)); 414004bedebSBruce Evans void setidt __P((int idx, alias_for_inthand_t *func, int typ, 4152838c968SDavid Greenman int dpl, int selec)); 41626931201SDavid Greenman 417004bedebSBruce Evans #endif /* !_MACHINE_CPUFUNC_H_ */ 418